mesa: Add ARB_direct_state_access checks in query object functions
authorFredrik Höglund <fredrik@kde.org>
Sun, 10 May 2015 18:57:29 +0000 (20:57 +0200)
committerFredrik Höglund <fredrik@kde.org>
Thu, 14 May 2015 13:48:17 +0000 (15:48 +0200)
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
src/mesa/main/queryobj.c

index 5ff1b95323194a0ec73fe78dd686ce4d03fe7b61..2784b4c0532c05e58788e7550ea27a1dd73d081d 100644 (file)
@@ -284,6 +284,13 @@ _mesa_CreateQueries(GLenum target, GLsizei n, GLuint *ids)
 {
    GET_CURRENT_CONTEXT(ctx);
 
+   if (!ctx->Extensions.ARB_direct_state_access) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glCreateQueries(GL_ARB_direct_state_access "
+                  "is not supported)");
+      return;
+   }
+
    switch (target) {
    case GL_SAMPLES_PASSED:
    case GL_ANY_SAMPLES_PASSED: