- if (!_mesa_validate_sync(ctx, syncObj)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glObjectPtrLabel (not a valid sync object)");
+ syncObj = _mesa_get_and_ref_sync(ctx, (void*)ptr, true);
+
+ if (_mesa_is_desktop_gl(ctx))
+ callerstr = "glObjectPtrLabel";
+ else
+ callerstr = "glObjectPtrLabelKHR";
+
+ if (!syncObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s (not a valid sync object)",
+ callerstr);