mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-23 23:32:44 +01:00
video_core: Allow LabelGLObject to use extra info on any object
This commit is contained in:
parent
6e4d2e672d
commit
4d0c682468
1 changed files with 14 additions and 10 deletions
|
@ -169,17 +169,21 @@ static void LabelGLObject(GLenum identifier, GLuint handle, VAddr addr,
|
||||||
const std::string nice_addr = fmt::format("0x{:016x}", addr);
|
const std::string nice_addr = fmt::format("0x{:016x}", addr);
|
||||||
std::string object_label;
|
std::string object_label;
|
||||||
|
|
||||||
|
if (extra_info.empty()) {
|
||||||
switch (identifier) {
|
switch (identifier) {
|
||||||
case GL_TEXTURE:
|
case GL_TEXTURE:
|
||||||
object_label = extra_info + "@" + nice_addr;
|
object_label = "Texture@" + nice_addr;
|
||||||
break;
|
break;
|
||||||
case GL_PROGRAM:
|
case GL_PROGRAM:
|
||||||
object_label = "ShaderProgram@" + nice_addr;
|
object_label = "Shader@" + nice_addr;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
object_label = fmt::format("Object(0x{:x})@{}", identifier, nice_addr);
|
object_label = fmt::format("Object(0x{:x})@{}", identifier, nice_addr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
object_label = extra_info + '@' + nice_addr;
|
||||||
|
}
|
||||||
glObjectLabel(identifier, handle, -1, static_cast<const GLchar*>(object_label.c_str()));
|
glObjectLabel(identifier, handle, -1, static_cast<const GLchar*>(object_label.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue