fix(ImGuiImplGl3): enhance OpenGL compatibility checks for sampler objects by Lyzev · Pull Request #320 · SpaiR/imgui-java
Description
This PR adds a check for GL Capabilities to enable support for sampler objects if the GL_ARB_sampler_objects flag is available, even if the GL version is below 3.3.
Feel free to let me know if additional information is needed or if any modifications to the implementation are required.
Note: Storing and restoring sampler objects in this specific case will likely be rare. However, I encountered such a situation, which is why I decided to contribute this fix to imgui-java.
Context
I encountered a bug while using imgui-java in a project where I implemented HumbleUI/Skija in Minecraft 1.21.4. The bug caused unintended texture behavior because Skija binds a sampler object when rendering and does not unbind it. After analyzing the issue with RenderDoc, I discovered that this behavior was due to the GL_ARB_sampler_objects capability being available, even though the GL version was 3.2.
Implementation
The implementation includes:
- Adding a check for
GLCapabilitiesandGL_ARB_sampler_objects. - Safely handling potential
IllegalStateExceptionwhen retrieving GL capabilities.
Type of change
- Minor changes or tweaks (quality of life stuff)
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update