diff options
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLTexture.cpp | 8 |
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); |
