mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
opengl: add version checks when setting debug names.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user