2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

video_core: Allow LabelGLObject to use extra info on any object

This commit is contained in:
ReinUsesLisp 2018-10-06 23:13:46 -03:00
parent 6e4d2e672d
commit 4d0c682468

View file

@ -169,16 +169,20 @@ 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;
switch (identifier) { if (extra_info.empty()) {
case GL_TEXTURE: switch (identifier) {
object_label = extra_info + "@" + nice_addr; case GL_TEXTURE:
break; object_label = "Texture@" + nice_addr;
case GL_PROGRAM: break;
object_label = "ShaderProgram@" + nice_addr; case GL_PROGRAM:
break; object_label = "Shader@" + nice_addr;
default: break;
object_label = fmt::format("Object(0x{:x})@{}", identifier, nice_addr); default:
break; object_label = fmt::format("Object(0x{:x})@{}", identifier, nice_addr);
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()));
} }