From ea1ac73c38338aa90adecf9be54b1c7f8e4a3392 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sun, 30 Jan 2022 21:46:17 -0500 Subject: [PATCH] OGLShader: Only set shader name if supported --- Source/Core/VideoBackends/OGL/OGLShader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/OGLShader.cpp b/Source/Core/VideoBackends/OGL/OGLShader.cpp index 4ba2143c6e..0327f083f4 100644 --- a/Source/Core/VideoBackends/OGL/OGLShader.cpp +++ b/Source/Core/VideoBackends/OGL/OGLShader.cpp @@ -5,6 +5,8 @@ #include "VideoBackends/OGL/ProgramShaderCache.h" +#include "VideoCommon/VideoConfig.h" + namespace OGL { static GLenum GetGLShaderTypeForStage(ShaderStage stage) @@ -29,7 +31,7 @@ OGLShader::OGLShader(ShaderStage stage, GLenum gl_type, GLuint gl_id, std::strin : AbstractShader(stage), m_id(ProgramShaderCache::GenerateShaderID()), m_type(gl_type), m_gl_id(gl_id), m_source(std::move(source)), m_name(std::move(name)) { - if (!m_name.empty()) + if (!m_name.empty() && g_ActiveConfig.backend_info.bSupportsSettingObjectNames) { glObjectLabel(GetGLShaderTypeForStage(stage), m_gl_id, -1, m_name.c_str()); } @@ -40,7 +42,7 @@ OGLShader::OGLShader(GLuint gl_compute_program_id, std::string source, std::stri m_type(GL_COMPUTE_SHADER), m_gl_compute_program_id(gl_compute_program_id), m_source(std::move(source)), m_name(std::move(name)) { - if (!m_name.empty()) + if (!m_name.empty() && g_ActiveConfig.backend_info.bSupportsSettingObjectNames) { glObjectLabel(GL_COMPUTE_SHADER, m_gl_compute_program_id, -1, m_name.c_str()); }