* will be returned in <length>."
*/
+ if (src)
+ labelLen = strlen(src);
+
if (bufSize == 0) {
if (length)
- *length = strlen(src);
+ *length = labelLen;
return;
}
- if (src)
- labelLen = strlen(src);
if (dst) {
if (src) {
break;
case GL_TRANSFORM_FEEDBACK:
{
+ /* From the GL 4.5 specification, page 536:
+ * "An INVALID_VALUE error is generated if name is not the name of a
+ * valid object of the type specified by identifier."
+ */
struct gl_transform_feedback_object *tfo =
_mesa_lookup_transform_feedback_object(ctx, name);
- if (tfo)
+ if (tfo && tfo->EverBound)
labelPtr = &tfo->Label;
}
break;
case GL_TEXTURE:
{
struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, name);
- if (texObj)
+ if (texObj && texObj->Target)
labelPtr = &texObj->Label;
}
break;