From 8b969dfeab3b6f545e334a9d0f02fb6feff2e60c Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Fri, 24 May 2024 20:45:40 -0700 Subject: [PATCH] Correct uSamplerEnable uniform in ImGui shader; make sure to pop the unused imgui command before rendering Makes gui.drawString somewhat work under OpenGL, but there's still something wrong when it's combined with other draw functions --- src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs | 2 +- src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs b/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs index 0e82d0ab3e..fb06d7c837 100644 --- a/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs +++ b/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs @@ -164,7 +164,7 @@ void main() public const string ImGuiPixelShader_gl = @" //opengl 3.0 #version 130 -bool uSamplerEnable; +uniform bool uSamplerEnable; uniform sampler2D uSampler0; in vec2 vTexcoord0; diff --git a/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs b/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs index 2ca807a174..d4c41879dc 100644 --- a/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs +++ b/src/BizHawk.Bizware.Graphics/Renderers/ImGui2DRenderer.cs @@ -281,6 +281,7 @@ namespace BizHawk.Bizware.Graphics DrawImage(_stringOutput, 0, 0); } + _imGuiDrawList._PopUnusedDrawCmd(); RenderInternal(width, height); ResetDrawList(); }