fix(ImGuiImplGl3): enhance OpenGL compatibility checks for sampler objects #320
+15
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
GLCapabilities
andGL_ARB_sampler_objects
.IllegalStateException
when retrieving GL capabilities.Type of change