summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/OGLTexture.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-08-30 21:00:24 +0200
committerGitHub <noreply@github.com>2021-08-30 21:00:24 +0200
commitd94aa913f585d8f743bbe6c373ca9fb029de77b7 (patch)
treedfe18ba017a6cda4a79c01c10431c7c37e8f74a3 /Source/Core/VideoBackends/OGL/OGLTexture.cpp
parent9b83cf3e7fdf6fc4d15b78193461fd1081d61008 (diff)
parent1f2f5053735b4e94dac29237e9482befd9a2687b (diff)
Merge pull request #10065 from iwubcode/graphics-debug-details
VideoBackends / VideoCommon: expose ability to view shader/texture debug names
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLTexture.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.cpp b/Source/Core/VideoBackends/OGL/OGLTexture.cpp
index 7023a254d9..83c1d1b419 100644
--- a/Source/Core/VideoBackends/OGL/OGLTexture.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLTexture.cpp
@@ -104,7 +104,8 @@ bool UsePersistentStagingBuffers()
}
} // Anonymous namespace
-OGLTexture::OGLTexture(const TextureConfig& tex_config) : AbstractTexture(tex_config)
+OGLTexture::OGLTexture(const TextureConfig& tex_config, std::string_view name)
+ : AbstractTexture(tex_config), m_name(name)
{
DEBUG_ASSERT_MSG(VIDEO, !tex_config.IsMultisampled() || tex_config.levels == 1,
"OpenGL does not support multisampled textures with mip levels");
@@ -114,6 +115,11 @@ OGLTexture::OGLTexture(const TextureConfig& tex_config) : AbstractTexture(tex_co
glActiveTexture(GL_MUTABLE_TEXTURE_INDEX);
glBindTexture(target, m_texId);
+ if (!m_name.empty())
+ {
+ glObjectLabel(GL_TEXTURE, m_texId, -1, m_name.c_str());
+ }
+
glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, m_config.levels - 1);
GLenum gl_internal_format = GetGLInternalFormatForTextureFormat(m_config.format, true);