# KHR\_debug: glObjectLabel() issues

**URL:** <https://forums.imgtec.com/t/khr-debug-globjectlabel-issues/2323>\
**Category:** PowerVR Insider\
**Tags:** pvrvframe, pvrtrace\
**Created:** [July 13, 2015, 1:34pm UTC](https://forums.imgtec.com/t/khr-debug-globjectlabel-issues/2323 "2015-07-13T13:34:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dark\_photon](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/dark_photon/32/224_2.png) [@dark\_photon](https://forums.imgtec.com/u/dark_photon)\
**Post date:** [July 13, 2015, 1:34pm UTC](https://forums.imgtec.com/t/khr-debug-globjectlabel-issues/2323/1 "2015-07-13T13:34:08Z")

</div>

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().

---

<div class="post-metadata">

**Author:** ![dark\_photon](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/dark_photon/32/224_2.png) [@dark\_photon](https://forums.imgtec.com/u/dark_photon)\
**Post date:** [July 13, 2015, 3:53pm UTC](https://forums.imgtec.com/t/khr-debug-globjectlabel-issues/2323/2 "2015-07-13T15:53:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PaulLy](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@PaulLy](https://forums.imgtec.com/u/PaulLy)\
**Post date:** [July 15, 2015, 1:44pm UTC](https://forums.imgtec.com/t/khr-debug-globjectlabel-issues/2323/3 "2015-07-15T13:44:02Z")

</div>

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