mesa: implement ARB_compatibility
authorMarek Olšák <marek.olsak@amd.com>
Wed, 14 Feb 2018 19:12:51 +0000 (20:12 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 23 Feb 2018 19:50:15 +0000 (20:50 +0100)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/compiler/glsl/builtin_functions.cpp
src/compiler/glsl/builtin_types.cpp
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h
src/mesa/main/extensions_table.h
src/mesa/main/mtypes.h

index 293e8bd638ff2605cc427cf6151a26d230dd7ecb..5f772c9eaba4393fbd4bc8a3a10865cf30175005 100644 (file)
@@ -104,7 +104,7 @@ static bool
 compatibility_vs_only(const _mesa_glsl_parse_state *state)
 {
    return state->stage == MESA_SHADER_VERTEX &&
-          state->language_version <= 130 &&
+          (state->compat_shader || state->ARB_compatibility_enable) &&
           !state->es_shader;
 }
 
index b64f75779bc253564fd7d8f5eebe746623363861..7a01cb48bc8f7a22d6d49b8e77b33d42b6a96e97 100644 (file)
@@ -288,7 +288,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
    /* Add deprecated structure types.  While these were deprecated in 1.30,
     * they're still present.  We've removed them in 1.40+ (OpenGL 3.1+).
     */
-   if (state->compat_shader) {
+   if (state->compat_shader || state->ARB_compatibility_enable) {
       for (unsigned i = 0; i < ARRAY_SIZE(deprecated_types); i++) {
          add_type(symbols, deprecated_types[i]);
       }
index a686cb6a457c0982c315227bb54ce5e0a997925e..f0210b60bc7c14396b0652bd1e4b6eb9fdde1194 100644 (file)
@@ -441,7 +441,7 @@ private:
 builtin_variable_generator::builtin_variable_generator(
    exec_list *instructions, struct _mesa_glsl_parse_state *state)
    : instructions(instructions), state(state), symtab(state->symbols),
-     compatibility(state->compat_shader || !state->is_version(140, 100)),
+     compatibility(state->compat_shader || state->ARB_compatibility_enable),
      bool_t(glsl_type::bool_type), int_t(glsl_type::int_type),
      uint_t(glsl_type::uint_type),
      uint64_t(glsl_type::uint64_t_type),
index d99916d8ada5f4193c8b923f9d1655b4a382796c..81d74e92ce3cbd403389f5d9a879609d356ff6e0 100644 (file)
@@ -616,6 +616,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_ES3_2_compatibility),
    EXT(ARB_arrays_of_arrays),
    EXT(ARB_bindless_texture),
+   EXT(ARB_compatibility),
    EXT(ARB_compute_shader),
    EXT(ARB_compute_variable_group_size),
    EXT(ARB_conservative_depth),
index 508befd4606c6b3cc263e4ab4f3fe8b262e1c4fe..f88cb78347379caadde1fe70ebf15e6108a018a3 100644 (file)
@@ -609,6 +609,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_arrays_of_arrays_warn;
    bool ARB_bindless_texture_enable;
    bool ARB_bindless_texture_warn;
+   bool ARB_compatibility_enable;
+   bool ARB_compatibility_warn;
    bool ARB_compute_shader_enable;
    bool ARB_compute_shader_warn;
    bool ARB_compute_variable_group_size_enable;
index f4925ed442be295f4ea6dd352ca5a6cea0c4dce5..02c97a242ab19859903f7e83db71aaead51375bc 100644 (file)
@@ -40,6 +40,7 @@ EXT(ARB_clear_buffer_object                 , dummy_true
 EXT(ARB_clear_texture                       , ARB_clear_texture                      , GLL, GLC,  x ,  x , 2013)
 EXT(ARB_clip_control                        , ARB_clip_control                       , GLL, GLC,  x ,  x , 2014)
 EXT(ARB_color_buffer_float                  , ARB_color_buffer_float                 , GLL, GLC,  x ,  x , 2004)
+EXT(ARB_compatibility                       , ARB_compatibility                      , GLL,  x ,  x ,  x , 2009)
 EXT(ARB_compressed_texture_pixel_storage    , dummy_true                             , GLL, GLC,  x ,  x , 2011)
 EXT(ARB_compute_shader                      , ARB_compute_shader                     , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_compute_variable_group_size         , ARB_compute_variable_group_size        , GLL, GLC,  x ,  x , 2013)
index 15f39cbacc33c876d14ab9c559cc982ff3f3c924..62b58cea991d46d90dc368f0fbc60d8de120bffb 100644 (file)
@@ -4177,6 +4177,7 @@ struct gl_extensions
    GLboolean ARB_clear_texture;
    GLboolean ARB_clip_control;
    GLboolean ARB_color_buffer_float;
+   GLboolean ARB_compatibility;
    GLboolean ARB_compute_shader;
    GLboolean ARB_compute_variable_group_size;
    GLboolean ARB_conditional_render_inverted;