Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@heinezen

Description

@heinezen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: rendererConcerns our graphics rendererbugBehaving differently as it should behavegood first issueSuitable for newcomerslang: c++Done in C++ codeopengl

    Type

    No type

    Projects

    Status

    ✅ Done

    Status

    renderer

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions