mesa: Add ARB_direct_state_access checks in texture functions
[mesa.git] / src / mesa / main / genmipmap.c
index 9aef090194e58dc0f5f29ededadb6760ce239463..32b9460ad077d00dbaa6f8e42564982362c9ae3d 100644 (file)
@@ -158,6 +158,13 @@ _mesa_GenerateTextureMipmap(GLuint texture)
    struct gl_texture_object *texObj;
    GET_CURRENT_CONTEXT(ctx);
 
+   if (!ctx->Extensions.ARB_direct_state_access) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glGenerateTextureMipmap(GL_ARB_direct_state_access "
+                  "is not supported)");
+      return;
+   }
+
    texObj = _mesa_lookup_texture_err(ctx, texture, "glGenerateTextureMipmap");
    if (!texObj)
       return;