gl: Trace memory readback operations to debug tracking when renderdoc compat is enabled

- Renderdoc does not show these calls so we need to insert the debug message
This commit is contained in:
kd-11 2026-03-10 03:06:08 +03:00
parent f6b7ecea74
commit 512eeb7dd2
3 changed files with 12 additions and 0 deletions

View file

@ -2,6 +2,7 @@
#include "capabilities.h"
#include "Utilities/StrUtil.h"
#include "Emu/system_config.h"
#include <unordered_set>
@ -43,6 +44,8 @@ namespace gl
all_extensions.emplace(reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i)));
}
RENDERDOC_debug = !!g_cfg.video.renderdoc_compatiblity;
#define CHECK_EXTENSION_SUPPORT(extension_short_name)\
do {\
if (all_extensions.contains("GL_"#extension_short_name)) {\

View file

@ -23,6 +23,7 @@ namespace gl
bool initialized = false;
version_info glsl_version;
bool RENDERDOC_debug = false;
bool EXT_direct_state_access_supported = false;
bool EXT_depth_bounds_test_supported = false;
bool AMD_pinned_memory_supported = false;

View file

@ -246,6 +246,14 @@ namespace gl
pixel_settings.apply();
const auto& caps = get_driver_caps();
if (caps.RENDERDOC_debug)
{
const auto msg = fmt::format("glGetTextureSubImage('[%u] %s', %u, %u, %u, %u, %u, %u, %u, %u, %u, %d, %p)",
m_id, m_name.c_str(), level, region.x, region.y, region.z, region.width, region.height, region.depth,
static_cast<GLenum>(format), static_cast<GLenum>(type), s32{ smax }, dst.data());
push_debug_label(msg);
}
if (!region.x && !region.y && !region.z &&
region.width == m_width && region.height == m_height && region.depth == m_depth)
{