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

"GL_INVALID_OPERATION: Array object is not active" when rendering bufferless quad #1659

Open
heinezen opened this issue Jul 20, 2024 · 0 comments
Labels
area: renderer Concerns our graphics renderer bug Behaving differently as it should behave lang: c++ Done in C++ code opengl

Comments

@heinezen
Copy link
Member

Description

OpenGL generates an error when a bufferless quad is drawn but no VAO is bound. This can happen in the renderer here (line 57):

case geometry_t::bufferless_quad:
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
break;

Even though glDrawArrays doesn't read from a buffer, it requires a VAO as stated in the OpenGL Wiki:

A non-zero Vertex Array Object must be bound (though no arrays have to be enabled, so it can be a freshly-created vertex array object).

How To Reproduce

  1. Create a GlGeometry object with a bufferless quad, e.g. with renderer::opengl::GlRenderer::add_bufferless_quad()
  2. Create a renderable with the geometry
  3. Add the renderable to a render pass
  4. Render the render pass and observe the error

Expected Behavior

An empty VAO should be created and bound when trying to render a bufferless quad.

@heinezen heinezen added bug Behaving differently as it should behave area: renderer Concerns our graphics renderer lang: c++ Done in C++ code opengl labels Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer bug Behaving differently as it should behave lang: c++ Done in C++ code opengl
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant