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

fgOpenGL: check for GL errors after GetCaps #68

Draft
wants to merge 1 commit into
base: scopes
Choose a base branch
from

Conversation

LunNova
Copy link

@LunNova LunNova commented Jan 23, 2023

If one of the calls in GetCaps failed a GL error could be left unhandled causing the next operation such as creating a buffer to mysteriously fail.

On my machine with an AMD card - which doesn't support the *_NV extensions used in GetCaps - this caused the compute test to fail as the first create buffer call would pick up the leftover error.

This feels like more of a bodge than a proper fix as it's logging the error without knowing what to do with it, so I'm leaving this as a draft.

It looks like most places use CALLGL to handle errors after each GL call, but GetCaps isn't fallible so I can't use that here without changing the interface.

fgOpenGL/ProviderGL.cpp Outdated Show resolved Hide resolved
@LunNova LunNova force-pushed the get-caps-can-fail branch 3 times, most recently from 7446cdd to 16cb4d2 Compare January 29, 2023 02:40
Otherwise, if getting a capability failed a GL error could be left unhandled causing the next
operation such as creating a buffer to mysteriously fail.

fgOpenGL: Skip retrieving GL_NV_mesh_shader capabilities if it isn't supported
@LunNova
Copy link
Author

LunNova commented Jan 29, 2023

I added a check for GLAD_GL_NV_mesh_shader so it doesn't log a pile of errors if that's not supported.

Still not sure about the approach.

@LunNova
Copy link
Author

LunNova commented Jan 29, 2023

clang-format wrapping from adding the log macro with a long name also looks kinda yuck

LunNova added a commit to LunNova/feathergui that referenced this pull request Feb 11, 2023
…values in GetCaps

This is a minimal fix for the issue in Fundament-Software#68.

Doesn't try to fix not testing the error state after each individual call there as I still haven't figured out a nice way and noone has suggested one. This at least ensures backendtest works on AMD machines.
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.

1 participant