diff --git a/src/modules/graphics/opengl/Buffer.cpp b/src/modules/graphics/opengl/Buffer.cpp index be437d3ec..04a843559 100644 --- a/src/modules/graphics/opengl/Buffer.cpp +++ b/src/modules/graphics/opengl/Buffer.cpp @@ -164,7 +164,7 @@ bool Buffer::load(const void *initialdata) glTexBuffer(target, glformat, buffer); } - if (!debugName.empty()) + if (!debugName.empty() && (GLAD_VERSION_4_3 || GLAD_ES_VERSION_3_2)) glObjectLabel(GL_BUFFER, buffer, -1, debugName.c_str()); return (glGetError() == GL_NO_ERROR); diff --git a/src/modules/graphics/opengl/Texture.cpp b/src/modules/graphics/opengl/Texture.cpp index 9343a9f68..afa4e1e01 100644 --- a/src/modules/graphics/opengl/Texture.cpp +++ b/src/modules/graphics/opengl/Texture.cpp @@ -422,12 +422,18 @@ bool Texture::loadVolatile() setGraphicsMemorySize(memsize); - if (!debugName.empty()) + if (!debugName.empty() && (GLAD_VERSION_4_3 || GLAD_ES_VERSION_3_2)) { if (texture) glObjectLabel(GL_TEXTURE, texture, -1, debugName.c_str()); - else - glObjectLabel(GL_FRAMEBUFFER, renderbuffer, -1, debugName.c_str()); + + if (renderbuffer) + { + std::string rname = debugName; + if (actualSamples > 1) + rname += " (MSAA buffer)"; + glObjectLabel(GL_RENDERBUFFER, renderbuffer, -1, rname.c_str()); + } } return true;