mesa: Add ARB_direct_state_access checks in texture functions
[mesa.git] / src / mesa / main / texstorage.c
index 53cb2c091f892638f14bdadf6e5cc2cd817fcd64..dee74a825ea25832de484f6638e87bb6315a4d7f 100644 (file)
@@ -507,6 +507,13 @@ texturestorage(GLuint dims, GLuint texture, GLsizei levels,
                   _mesa_lookup_enum_by_nr(internalformat),
                   width, height, depth);
 
+   if (!ctx->Extensions.ARB_direct_state_access) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glTextureStorage%uD(GL_ARB_direct_state_access "
+                  "is not supported)", dims);
+      return;
+   }
+
    /* Check the format to make sure it is sized. */
    if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
       _mesa_error(ctx, GL_INVALID_ENUM,