Mesa (glsl2): glsl2: Make gl_FragData be available in GLSL 1.10 too

Ian Romanick idr at kemper.freedesktop.org
Tue Jun 29 15:35:16 PDT 2010


Module: Mesa
Branch: glsl2
Commit: 9c4b1f2bad97b1b83c6bf01db567be5494dfaee5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c4b1f2bad97b1b83c6bf01db567be5494dfaee5

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Jun 29 15:10:09 2010 -0700

glsl2: Make gl_FragData be available in GLSL 1.10 too

---

 src/glsl/ir_variable.cpp |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp
index 44c3065..6e466fa 100644
--- a/src/glsl/ir_variable.cpp
+++ b/src/glsl/ir_variable.cpp
@@ -30,6 +30,9 @@
 #define Elements(x) (sizeof(x)/sizeof(*(x)))
 #endif
 
+static void generate_ARB_draw_buffers_fs_variables(exec_list *,
+    struct _mesa_glsl_parse_state *, bool);
+
 static ir_variable *
 add_variable(const char *name, enum ir_variable_mode mode, int slot,
 	     const glsl_type *type, exec_list *instructions,
@@ -246,6 +249,8 @@ generate_110_fs_variables(exec_list *instructions,
 
    add_variable("gl_TexCoord", ir_var_in, FRAG_ATTRIB_TEX0, vec4_array_type,
 		instructions, state->symbols);
+
+   generate_ARB_draw_buffers_fs_variables(instructions, state, false);
 }
 
 
@@ -272,7 +277,6 @@ generate_120_fs_variables(exec_list *instructions,
 			  struct _mesa_glsl_parse_state *state)
 {
    generate_110_fs_variables(instructions, state);
-   generate_ARB_draw_buffers_fs_variables(instructions, state, false);
 }
 
 static void
@@ -309,17 +313,6 @@ initialize_fs_variables(exec_list *instructions,
       generate_130_fs_variables(instructions, state);
       break;
    }
-
-
-   /* Since GL_ARB_draw_buffers is included in GLSL 1.20 and later, we
-    * can basically ignore any extension settings for it.
-    */
-   if (state->language_version < 120) {
-      if (state->ARB_draw_buffers_enable) {
-	 generate_ARB_draw_buffers_fs_variables(instructions, state,
-						state->ARB_draw_buffers_warn);
-      }
-   }
 }
 
 void



More information about the mesa-commit mailing list