add texture:getDebugName and buffer:getDebugName

This commit is contained in:
niki
2023-12-14 00:09:08 +01:00
parent 834398335d
commit 7a25dfa7fc
15 changed files with 47 additions and 25 deletions
+2 -3
View File
@@ -68,7 +68,6 @@ static GLenum getGLFormat(DataFormat format)
Buffer::Buffer(love::graphics::Graphics *gfx, const Settings &settings, const std::vector<DataDeclaration> &format, const void *data, size_t size, size_t arraylength)
: love::graphics::Buffer(gfx, settings, format, size, arraylength)
, debugName(settings.debugName)
{
size = getSize();
arraylength = getArrayLength();
@@ -165,8 +164,8 @@ bool Buffer::load(const void *initialdata)
glTexBuffer(target, glformat, buffer);
}
if (!debugName.empty())
glObjectLabel(GL_BUFFER, buffer, -1, debugName.c_str());
if (debugName.hasValue)
glObjectLabel(GL_BUFFER, buffer, -1, debugName.value.c_str());
return (glGetError() == GL_NO_ERROR);
}
-2
View File
@@ -81,8 +81,6 @@ private:
Range mappedRange;
std::string debugName;
}; // Buffer
} // opengl
+3 -4
View File
@@ -227,7 +227,6 @@ Texture::Texture(love::graphics::Graphics *gfx, const Settings &settings, const
, framebufferStatus(GL_FRAMEBUFFER_COMPLETE)
, textureGLError(GL_NO_ERROR)
, actualSamples(1)
, debugName(settings.debugName)
{
if (data != nullptr)
slices = *data;
@@ -423,12 +422,12 @@ bool Texture::loadVolatile()
setGraphicsMemorySize(memsize);
if (!debugName.empty())
if (debugName.hasValue)
{
if (texture)
glObjectLabel(GL_TEXTURE, texture, -1, debugName.c_str());
glObjectLabel(GL_TEXTURE, texture, -1, debugName.value.c_str());
else
glObjectLabel(GL_FRAMEBUFFER, renderbuffer, -1, debugName.c_str());
glObjectLabel(GL_FRAMEBUFFER, renderbuffer, -1, debugName.value.c_str());
}
return true;
-3
View File
@@ -78,9 +78,6 @@ private:
GLenum textureGLError;
int actualSamples;
std::string debugName;
}; // Texture
} // opengl