On a query that was never begun.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302>
*/
*bytesWritten = 0;
+ /* Not explicitly covered in the spec but a query that was never started
+ * cannot return any data.
+ */
+ if (!obj->Used) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetPerfQueryDataINTEL(query never began)");
+ return;
+ }
+
/* Not explicitly covered in the spec but to be consistent with
* EndPerfQuery which validates that an application only ends an
* active query we also validate that an application doesn't try