glsl: Don't include the deprecated structure types in GLSL 1.40.
authorEric Anholt <eric@anholt.net>
Thu, 15 Mar 2012 16:29:47 +0000 (09:29 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 20 Mar 2012 05:14:02 +0000 (22:14 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_types.cpp
src/glsl/glsl_types.h

index 4baec4195f909bdb954426c730ea534b727de3a9..069ebd10d6c3efc4966ecf66809dcd7bc8c41f0e 100644 (file)
@@ -169,7 +169,7 @@ glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
 }
 
 void
-glsl_type::generate_110_types(glsl_symbol_table *symtab)
+glsl_type::generate_110_types(glsl_symbol_table *symtab, bool add_deprecated)
 {
    generate_100ES_types(symtab);
 
@@ -177,16 +177,18 @@ glsl_type::generate_110_types(glsl_symbol_table *symtab)
                             Elements(builtin_110_types),
                             false);
    add_types_to_symbol_table(symtab, &_sampler3D_type, 1, false);
-   add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
-                            Elements(builtin_110_deprecated_structure_types),
-                            false);
+   if (add_deprecated) {
+      add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
+                               Elements(builtin_110_deprecated_structure_types),
+                               false);
+   }
 }
 
 
 void
-glsl_type::generate_120_types(glsl_symbol_table *symtab)
+glsl_type::generate_120_types(glsl_symbol_table *symtab, bool add_deprecated)
 {
-   generate_110_types(symtab);
+   generate_110_types(symtab, add_deprecated);
 
    add_types_to_symbol_table(symtab, builtin_120_types,
                             Elements(builtin_120_types), false);
@@ -194,9 +196,9 @@ glsl_type::generate_120_types(glsl_symbol_table *symtab)
 
 
 void
-glsl_type::generate_130_types(glsl_symbol_table *symtab)
+glsl_type::generate_130_types(glsl_symbol_table *symtab, bool add_deprecated)
 {
-   generate_120_types(symtab);
+   generate_120_types(symtab, add_deprecated);
 
    add_types_to_symbol_table(symtab, builtin_130_types,
                             Elements(builtin_130_types), false);
@@ -207,7 +209,7 @@ glsl_type::generate_130_types(glsl_symbol_table *symtab)
 void
 glsl_type::generate_140_types(glsl_symbol_table *symtab)
 {
-   generate_130_types(symtab);
+   generate_130_types(symtab, false);
 
    add_types_to_symbol_table(symtab, builtin_140_types,
                             Elements(builtin_140_types), false);
@@ -259,13 +261,13 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
       glsl_type::generate_100ES_types(state->symbols);
       break;
    case 110:
-      glsl_type::generate_110_types(state->symbols);
+      glsl_type::generate_110_types(state->symbols, true);
       break;
    case 120:
-      glsl_type::generate_120_types(state->symbols);
+      glsl_type::generate_120_types(state->symbols, true);
       break;
    case 130:
-      glsl_type::generate_130_types(state->symbols);
+      glsl_type::generate_130_types(state->symbols, true);
       break;
    case 140:
       glsl_type::generate_140_types(state->symbols);
index 8f2a3ff38caad051df0068e820b7d1d943d222cf..48d41d7f8e68f3ed07c37026317e2815abee7768 100644 (file)
@@ -515,9 +515,9 @@ private:
     */
    /*@{*/
    static void generate_100ES_types(glsl_symbol_table *);
-   static void generate_110_types(glsl_symbol_table *);
-   static void generate_120_types(glsl_symbol_table *);
-   static void generate_130_types(glsl_symbol_table *);
+   static void generate_110_types(glsl_symbol_table *, bool add_deprecated);
+   static void generate_120_types(glsl_symbol_table *, bool add_deprecated);
+   static void generate_130_types(glsl_symbol_table *, bool add_deprecated);
    static void generate_140_types(glsl_symbol_table *);
    static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool);
    static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);