Skip to content

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

@philipguin

Description

@philipguin

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions