glsl: Make GL_ARB_shader_stencil_export enable block be similar to other blocks
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 8 Apr 2011 19:43:53 +0000 (12:43 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 11 Apr 2011 21:43:42 +0000 (14:43 -0700)
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_parser_extras.cpp

index 073ec383210743c9c9229895c58ecf2883d9ec4f..e8881e4d60e6d1a287c97e4cdd970c22ba012656 100644 (file)
@@ -241,13 +241,13 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
 
       unsupported = !state->extensions->EXT_texture_array;
    } else if (strcmp(name, "GL_ARB_shader_stencil_export") == 0) {
-      if (state->target != fragment_shader) {
-        unsupported = true;
-      } else {
-        state->ARB_shader_stencil_export_enable = (ext_mode != extension_disable);
-        state->ARB_shader_stencil_export_warn = (ext_mode == extension_warn);
-        unsupported = !state->extensions->ARB_shader_stencil_export;
-      }
+      state->ARB_shader_stencil_export_enable = (ext_mode != extension_disable);
+      state->ARB_shader_stencil_export_warn = (ext_mode == extension_warn);
+
+      /* This extension is only supported in fragment shaders.
+       */
+      unsupported = (state->target != fragment_shader)
+        || !state->extensions->ARB_shader_stencil_export;
    } else if (strcmp(name, "GL_AMD_conservative_depth") == 0) {
       /* The AMD_conservative spec does not forbid requiring the extension in
        * the vertex shader.