mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 21:28:51 +00:00
VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc
This commit is contained in:
parent
9b83cf3e7f
commit
1f2f505373
32 changed files with 276 additions and 133 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue