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.createCapabilities: add way to exclude arbitrary extensions #683

Closed
philipguin opened this issue Sep 30, 2021 · 2 comments
Closed

GL.createCapabilities: add way to exclude arbitrary extensions #683

philipguin opened this issue Sep 30, 2021 · 2 comments

Comments

@philipguin
Copy link

philipguin commented Sep 30, 2021

Description

Proposal in the title. The current way of achieving this basically involves adding your own logic after checking each specific extension flag on GLCapabilities, which is relatively brittle (e.g. when you aren't the only client of the GL and want full application testing), and not easily extended.

I believe this should generally work with regard to LWJGL itself, since extensions are by design optional features.

Use Cases

  1. Easy configuration testing, e.g. checking whether your application behaves correctly with or without an extension.
  2. An easy way to control extension use for the sake of external tools, e.g. NVIDIA Nsight, which fails with use of extensions like NV_command_list and NV_fill_rectangle.
  3. A way for users to disable extensions, either for troubleshooting purposes or as a workaround for application and driver bugs.

Solutions

Probably the easiest way would be to add a parameter to GLCapabilities createCapabilities(boolean forwardCompatible) called Set<String> excludedExtensions that is simply subtracted from the set reported by the driver just before passing them into GLCapabilities. Then it would be up to the developer to decide how best to inject them.

An alternative approach would be to read a comma-delimited list from a System.getProperty, which has the advantage of allowing user control without requiring thought or effort from developers. This may not be a universally desired feature, however. Applications that don't actually check for extensions could be broken, but the responsibility would clearly rest with the user in this case, imo. The downside is it wouldn't be programmatically controllable without manipulating System properties and doing String processing.

Problems

It's possible that a driver reports an extension that implies the driver cannot be used as though the extension didn't exist. I'm not intimate enough with every extension to know, but they commonly change language in the spec, which I could see having this effect (possibly unintentionally.) However, this sounds like a violation of the entire concept of extensions.

Conclusion

Hopefully this wasn't too formal, I just wanted to be thorough in making a suggestion. It's possible there's a better method of achieving this, in which case, do let me know.

Thanks for reading!

@Spasi
Copy link
Member

Spasi commented Oct 19, 2021

This will be available in 3.3.0 build 17 via Configuration options (e.g. OPENGL_EXTENSION_FILTER for OpenGL extensions). Thank you @philipguin!

@philipguin
Copy link
Author

Excellent! Thanks for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants