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
parent 357de0b8c3
commit e1dac32be0
No known key found for this signature in database

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