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

Fix "unbind geometry" MaterialXView OpenGL errors on MacOS #1126

Conversation

pablode
Copy link
Contributor

@pablode pablode commented Oct 30, 2022

In GlslProgram::unbindGeometry, glDisableVertexAttribArray is called. According to the specification, this requires a vertex array to be bound, which is not the case. On MacOS, the driver seems to be less lenient and returns an error which is then printed as "OpenGL error after program unbind geometry: 1282".

Since we destroy the vertex array a few lines later, there's no need to disable the attributes.

Removing the glDisableVertexAttribArray calls fixes the errors.

Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix, @pablode!

@jstone-lucasfilm jstone-lucasfilm merged commit 84d1461 into AcademySoftwareFoundation:main Oct 30, 2022
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
…ftwareFoundation#1126)

In GlslProgram::unbindGeometry, glDisableVertexAttribArray is called. According to the specification (https://registry.khronos.org/OpenGL-Refpages/gl4/html/glEnableVertexAttribArray.xhtml), this requires a vertex array to be bound, which is not the case. On MacOS, the driver seems to be less lenient and returns an error which is then printed as "OpenGL error after program unbind geometry: 1282".

Since we destroy the vertex array a few lines later, there's no need to disable the attributes.

Removing the glDisableVertexAttribArray calls fixes the errors.
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

Successfully merging this pull request may close these issues.

2 participants