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

fix(ImGuiImplGl3): enhance OpenGL compatibility checks for sampler objects #320

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

Lyzev
Copy link
Contributor

@Lyzev Lyzev commented Feb 1, 2025

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 GLCapabilities and GL_ARB_sampler_objects.
  • Safely handling potential IllegalStateException when 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

@SpaiR SpaiR added the fix Fixes problems label Feb 2, 2025
@SpaiR SpaiR merged commit 0ce3d60 into SpaiR:main Feb 2, 2025
7 checks passed
@SpaiR
Copy link
Owner

SpaiR commented Feb 2, 2025

@Lyzev Thanks for the contribution👍
fyi I'm planning to do the release at the beginning of the next week

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

Successfully merging this pull request may close these issues.

2 participants