From 60be8ced99bcac925834d90848e0d2523333a480 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Wed, 20 May 2026 13:07:28 -0700 Subject: [PATCH] renderer_gl: Fix DebugScope unconditional incrementing of `global_scope_depth` `global_scope_depth` was being incremented unconditionally in the ctor, but the dtor was decrementing it conditionally based on `Settings::values.renderer_debug`, allowing an imbalanced scope-depth hazard in the case that `Settings::values.renderer_debug` is operated at runtime during a debug-scope. --- src/video_core/renderer_opengl/gl_texture_runtime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_texture_runtime.cpp b/src/video_core/renderer_opengl/gl_texture_runtime.cpp index 75e701773..b35d8f8fe 100644 --- a/src/video_core/renderer_opengl/gl_texture_runtime.cpp +++ b/src/video_core/renderer_opengl/gl_texture_runtime.cpp @@ -716,7 +716,7 @@ Sampler::Sampler(TextureRuntime&, VideoCore::SamplerParams params) { Sampler::~Sampler() = default; DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f, std::string_view label) - : local_scope_depth{global_scope_depth++} { + : local_scope_depth{Settings::values.renderer_debug ? global_scope_depth++ : 0} { if (!Settings::values.renderer_debug) { return; }