Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about redundant bufferData call #60

Open
mateusz-malicki opened this issue Feb 9, 2024 · 0 comments
Open

Question about redundant bufferData call #60

mateusz-malicki opened this issue Feb 9, 2024 · 0 comments

Comments

@mateusz-malicki
Copy link
Contributor

mateusz-malicki commented Feb 9, 2024

Im working on a PR with a little cleanup, and there are a few redundant gl calls. Particularly expensive is populating depthIndex. Is there any reason to do it twice in RenderProgram? Everythink works fine if we keep only one call with buffer data. And there is realy no need to write depthIndex with every _render cycle - we should be doing it only if there is a new one.

  1. on message from sortWorker:

    gl.bufferData(gl.ARRAY_BUFFER, depthIndex, gl.STATIC_DRAW);

  2. in render method:

    gl.bufferData(gl.ARRAY_BUFFER, this.depthIndex, gl.STATIC_DRAW);

@dylanebert So, the question is: Is it done on purpose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant