KHR_debug: glObjectLabel() issues

Working with the KHR_debug support in PowerVR SDK 3.5 (PVRVFrame) to label program objects, buffers, and other GL objects, I have a few sugggestions and a problem report:

  1. In PVRTraceGUI, if I label a GL object with a meaningful name (e.g. program object 3 = “Sky dome shader”), when I see a use of that program object in the GL call trace (e.g. glUseProgram(3)), there seems to be no easy way to get access to its meaningful name.

It would be helpful if PVRTraceGUI provided this in the Information tab when you inspect the object. As a bonus, it would be helpful if this was displayed inline in the GL call trace (e.g. as a comment by the GL call):

[pre]
glUseProgram[ 3 ]; /* Sky dome shader */[/pre]

so you didn’t actually have to go inspect the object to see the name, and/or if it were displayed as a pop-up when you mouse over the object handle in the GL call.

  1. (Minor:) I’ve noticed that when labeling a buffer object via glObjectLabel(), labeling it after the name is created but before it’s bound triggers a GL_INVALID_OPERATION error on the glObjectLabel() statement.

[pre]GLuint handle;
glGenBuffers[ 1, &handle ];
if [ handle ]
{
glObjectLabelKHR[ GL_BUFFER_KHR, handle, -1, “Special VBO” ];
glBindBuffer[ GL_ARRAY_BUFFER, handle ];

} [/pre]

Move the glObjectLabel call down below first bind and it doesn’t trip a GL error. I think this behavior may be a bug.

The same is not true of program objects. PVRVFrame lets you label them immediately after glCreateProgram().

It’d also be helpful if PVRTraceGUI would decode the “identifier” type enumeration (1st arg) passed to glObjectLabel(). For example, for a program object label I see:

[pre]
glObjectLabel[ 0x82E2, 3, -1, “Sky” ];[/pre]

Minor suggestion.

Thanks, as always we’re welcome to any suggestions and feedback to improve our SDK and Utilities!