glsl: Only let a shader enable GL_ARB_draw_instanced if the driver supports it
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 8 Apr 2011 19:41:42 +0000 (12:41 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 11 Apr 2011 21:43:41 +0000 (14:43 -0700)
Also make the GL_ARB_draw_instanced block follow the same pattern as
the other blocks.

Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_parser_extras.cpp

index e8c60936fb6877c0722307522d7eb280b78dd649..073ec383210743c9c9229895c58ecf2883d9ec4f 100644 (file)
@@ -211,14 +211,13 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
         state->ARB_draw_buffers_warn = (ext_mode == extension_warn);
       }
    } else if (strcmp(name, "GL_ARB_draw_instanced") == 0) {
+      state->ARB_draw_instanced_enable = (ext_mode != extension_disable);
+      state->ARB_draw_instanced_warn = (ext_mode == extension_warn);
+
       /* This extension is only supported in vertex shaders.
        */
-      if (state->target != vertex_shader) {
-        unsupported = true;
-      } else {
-        state->ARB_draw_instanced_enable = (ext_mode != extension_disable);
-        state->ARB_draw_instanced_warn = (ext_mode == extension_warn);
-      }
+      unsupported = (state->target != vertex_shader)
+        ||  !state->extensions->ARB_draw_instanced;
    } else if (strcmp(name, "GL_ARB_explicit_attrib_location") == 0) {
       state->ARB_explicit_attrib_location_enable =
         (ext_mode != extension_disable);