summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-04-08 12:41:42 -0700
committerIan Romanick <[email protected]>2011-04-11 14:43:41 -0700
commitf2bda1b5664cd8a8744798926f2562212229d938 (patch)
tree419021d5177d93759048083a7af49deedfae4533 /src
parent88022278f71ed3ea9613a7fa72a03367f75443d3 (diff)
glsl: Only let a shader enable GL_ARB_draw_instanced if the driver supports it
Also make the GL_ARB_draw_instanced block follow the same pattern as the other blocks. Tested-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/glsl_parser_extras.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index e8c60936fb6..073ec383210 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -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);