add debugname to settings table for texture and buffer,
which can be used for debugging in e.g. RenderDoc.
This commit is contained in:
niki
2023-12-13 14:28:34 +01:00
parent 8951635abc
commit a5d7ba1589
14 changed files with 76 additions and 0 deletions
+4
View File
@@ -68,6 +68,7 @@ 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();
@@ -164,6 +165,9 @@ bool Buffer::load(const void *initialdata)
glTexBuffer(target, glformat, buffer);
}
if (!debugName.empty())
glObjectLabel(GL_BUFFER, buffer, -1, debugName.c_str());
return (glGetError() == GL_NO_ERROR);
}
+2
View File
@@ -81,6 +81,8 @@ private:
Range mappedRange;
std::string debugName;
}; // Buffer
} // opengl
+9
View File
@@ -227,6 +227,7 @@ 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;
@@ -422,6 +423,14 @@ bool Texture::loadVolatile()
setGraphicsMemorySize(memsize);
if (!debugName.empty())
{
if (texture)
glObjectLabel(GL_TEXTURE, texture, -1, debugName.c_str());
else
glObjectLabel(GL_FRAMEBUFFER, renderbuffer, -1, debugName.c_str());
}
return true;
}
+2
View File
@@ -79,6 +79,8 @@ private:
int actualSamples;
std::string debugName;
}; // Texture
} // opengl