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

glRenderbufferStorageMultisampleCoverageNV used on Mesa, despite not having NV_framebuffer_multisample_coverage #1028

Closed
AnyOldName3 opened this issue Jan 14, 2021 · 1 comment · Fixed by #1056

Comments

@AnyOldName3
Copy link
Contributor

glRenderbufferStorageMultisampleCoverageNV is provided by the NV_framebuffer_multisample_coverage extension for implementing what Nvidia call Coverage Sampled Antialiasing. It's used in OSG by osg::RenderBuffer::getObjectId following a check to osg::GLExtensions::isRenderbufferMultisampleCoverageSupported() in favour of the non-vendor-specific glRenderbufferStorageMultisample.

osg::GLExtensions::isRenderbufferMultisampleCoverageSupported() just checks whether or not the function pointer is null, which fails on Mesa as it exports the function, despite not implementing the relevant extension, and OSG doesn't check before setting the function pointer here. It seems that on Mesa, the call is a no-op, as I get incomplete FBO errors when OSG uses that path, but not if I replace the call with the non-coverage variant, and I can't find an actual implementation in the Mesa source, but can for the regular variant.

I expect that the most sensible solution would be to check for the presence of the actual extension, either before setting the function pointer or in isRenderbufferMultisampleCoverageSupported.

@glebm
Copy link
Contributor

glebm commented Mar 15, 2021

@robertosfield I can work on a PR for this if you have a preferred solution in mind

Should we guard the assignment with an if (and similar for glRenderbufferStorageMultisample):

if (isGLExtensionSupported(contextID, "NV_framebuffer_multisample_coverage"))
  setGLExtensionFuncPtr(glRenderbufferStorageMultisampleCoverageNV, "glRenderbufferStorageMultisampleCoverageNV", validContext);

Or should this be another two boolean fields in GLExtensions?

glebm added a commit to glebm/OpenSceneGraph that referenced this issue Mar 16, 2021
`isRenderbufferMultisampleCoverageSupported()` should not return true if
the extension is not supported.

Fixes openscenegraph#1028
robertosfield pushed a commit that referenced this issue Mar 29, 2021
`isRenderbufferMultisampleCoverageSupported()` should not return true if
the extension is not supported.

Fixes #1028
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 a pull request may close this issue.

2 participants