[Mesa-dev] [PATCH 52/57] mesa: Add ARB_direct_state_access checks in query object functions

Fredrik Höglund fredrik at kde.org
Mon May 11 10:27:18 PDT 2015


Signed-off-by: Fredrik Höglund <fredrik at kde.org>
---
 src/mesa/main/queryobj.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 5ff1b95..2784b4c 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -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:
-- 
2.1.4



More information about the mesa-dev mailing list