renderer_opengl: Add debug scopes to logging (#6650)

This commit is contained in:
GPUCode 2023-06-30 02:16:54 +03:00 committed by GitHub
parent d26dcc8e31
commit ca2d87e5e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -44,6 +44,8 @@ inline std::string_view GetType(GLenum type) {
RET(PERFORMANCE); RET(PERFORMANCE);
RET(OTHER); RET(OTHER);
RET(MARKER); RET(MARKER);
RET(POP_GROUP);
RET(PUSH_GROUP);
default: default:
UNREACHABLE(); UNREACHABLE();
} }

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/scope_exit.h" #include "common/scope_exit.h"
#include "common/settings.h"
#include "video_core/custom_textures/material.h" #include "video_core/custom_textures/material.h"
#include "video_core/regs.h" #include "video_core/regs.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
@ -702,10 +703,16 @@ Sampler::~Sampler() = default;
DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f, std::string_view label) DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f, std::string_view label)
: local_scope_depth{global_scope_depth++} { : local_scope_depth{global_scope_depth++} {
if (!Settings::values.renderer_debug) {
return;
}
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, local_scope_depth, label.size(), label.data()); glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, local_scope_depth, label.size(), label.data());
} }
DebugScope::~DebugScope() { DebugScope::~DebugScope() {
if (!Settings::values.renderer_debug) {
return;
}
glPopDebugGroup(); glPopDebugGroup();
global_scope_depth--; global_scope_depth--;
} }