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.
This commit is contained in:
Wunkolo 2026-05-20 13:07:28 -07:00 committed by PabloMK7
parent de15a7c79a
commit 60be8ced99

View file

@ -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;
}