mesa: Add ARB_direct_state_access checks in sampler object functions
authorFredrik Höglund <fredrik@kde.org>
Sun, 10 May 2015 18:55:31 +0000 (20:55 +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/samplerobj.c

index a3aacc66aa30f504ca973af674a8f718e5e2f418..60711a5b5e3071768505ea2363e1d40ef1fde206 100644 (file)
@@ -221,6 +221,13 @@ void GLAPIENTRY
 _mesa_CreateSamplers(GLsizei count, GLuint *samplers)
 {
    GET_CURRENT_CONTEXT(ctx);
+
+   if (!ctx->Extensions.ARB_direct_state_access) {
+      _mesa_error(ctx, GL_INVALID_OPERATION, "glCreateSamplers("
+                  "GL_ARB_direct_state_access is not supported)");
+      return;
+   }
+
    create_samplers(ctx, count, samplers, "glCreateSamplers");
 }