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

VAO is not update when change buffer binding #376

Closed
johanzhu opened this issue Jul 12, 2021 · 1 comment · Fixed by #719
Closed

VAO is not update when change buffer binding #376

johanzhu opened this issue Jul 12, 2021 · 1 comment · Fixed by #719
Assignees
Labels
bug Something isn't working high priority High priority issue Rendering Rendering related functions
Milestone

Comments

@johanzhu
Copy link
Contributor

johanzhu commented Jul 12, 2021

Describe the bug
When I change the buffer binding of a mesh, I got gl error: "GL_INVALID_OPERATION : glDrawElements: range out of bounds for buffer" if my new buffer' byteLength is larger.

GLPrimitive.ts line 39
if (!this.vao.has(shaderProgram.id)) {
this.registerVAO(shaderProgram);
}

According to above code, VAO is always get from cache.
VAO should update when mesh binding another new buffer .

To Reproduce
Steps to reproduce the behavior:

  1. Using mesh renderer rendering a mesh
  2. Using setVertexBufferBinding and setIndexBufferBinding bind new buffer to mesh, and new buffer's byte length is larger.
  3. Update sub mesh count.
  4. See error: GL_INVALID_OPERATION : glDrawElements: range out of bounds for buffer

Expected behavior
MeshRenderer working well, ant no gl error.

Screenshots
image

Desktop (please complete the following information):

  • OS: MacBook Pro (16-inch, 2019)
  • Browser chrome
@GuoLei1990 GuoLei1990 self-assigned this Jul 19, 2021
@GuoLei1990 GuoLei1990 added bug Something isn't working medium priority Medium priority issue labels Jul 19, 2021
@eyworldwide
Copy link
Member

You can highlight the code with markdown grammar:

if (!this.vao.has(shaderProgram.id)) {
   this.registerVAO(shaderProgram);
}

@GuoLei1990 GuoLei1990 added this to the 1.0 milestone Nov 15, 2022
@GuoLei1990 GuoLei1990 added high priority High priority issue Rendering Rendering related functions and removed medium priority Medium priority issue labels Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority High priority issue Rendering Rendering related functions
Projects
None yet
3 participants