mesa/glsl: add support for EXT_shader_implicit_conversions
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 25 Oct 2018 14:40:13 +0000 (16:40 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 2 Nov 2018 10:10:36 +0000 (11:10 +0100)
EXT_shader_implicit_conversions adds support for implicit conversions
for GLES 3.1 and above.

This is essentially a subset of ARB_gpu_shader5, and augments
OES_gpu_shader5.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h
src/compiler/glsl/ir_function.cpp
src/mesa/main/extensions_table.h

index 1bdd7c4bf17cd259678e8f736a33cb01e0ffef15..2a58908c2261c0a380db855aab2cd851bac69bb3 100644 (file)
@@ -718,6 +718,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(EXT_separate_shader_objects),
    EXT(EXT_shader_framebuffer_fetch),
    EXT(EXT_shader_framebuffer_fetch_non_coherent),
+   EXT(EXT_shader_implicit_conversions),
    EXT(EXT_shader_integer_mix),
    EXT_AEP(EXT_shader_io_blocks),
    EXT(EXT_shader_samples_identical),
index e1144a19c15493219a75a64824d2828370f59589..985200ecab575aab3324b7ae0d9da84d4026e96c 100644 (file)
@@ -346,13 +346,14 @@ struct _mesa_glsl_parse_state {
 
    bool has_implicit_conversions() const
    {
-      return is_version(120, 0);
+      return EXT_shader_implicit_conversions_enable || is_version(120, 0);
    }
 
    bool has_implicit_uint_to_int_conversion() const
    {
       return ARB_gpu_shader5_enable ||
              MESA_shader_integer_functions_enable ||
+             EXT_shader_implicit_conversions_enable ||
              is_version(400, 0);
    }
 
@@ -806,6 +807,8 @@ struct _mesa_glsl_parse_state {
    bool EXT_shader_framebuffer_fetch_warn;
    bool EXT_shader_framebuffer_fetch_non_coherent_enable;
    bool EXT_shader_framebuffer_fetch_non_coherent_warn;
+   bool EXT_shader_implicit_conversions_enable;
+   bool EXT_shader_implicit_conversions_warn;
    bool EXT_shader_integer_mix_enable;
    bool EXT_shader_integer_mix_warn;
    bool EXT_shader_io_blocks_enable;
index 3ee0d170fb232cf615935f98cbce295c13bbae74..97262f0f4b93c84c8903d830432a76e55a0b6169 100644 (file)
@@ -274,7 +274,8 @@ choose_best_inexact_overload(_mesa_glsl_parse_state *state,
     * assume everything supported in any GLSL version is available.
     */
    if (!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable ||
-       state->MESA_shader_integer_functions_enable) {
+       state->MESA_shader_integer_functions_enable ||
+       state->EXT_shader_implicit_conversions_enable) {
       for (ir_function_signature **sig = matches; sig < matches + num_matches; sig++) {
          if (is_best_inexact_overload(actual_parameters, matches, num_matches, *sig))
             return *sig;
index 47db15831352c174d0cf6a641c5a8efa1f2e0caa..e3bf7c9fcee368bdc32cc6c25a5bc7c41af2271f 100644 (file)
@@ -261,6 +261,7 @@ EXT(EXT_separate_shader_objects             , dummy_true
 EXT(EXT_separate_specular_color             , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_shader_framebuffer_fetch            , EXT_shader_framebuffer_fetch           , GLL, GLC,  x , ES2, 2013)
 EXT(EXT_shader_framebuffer_fetch_non_coherent, EXT_shader_framebuffer_fetch_non_coherent, GLL, GLC,  x, ES2, 2018)
+EXT(EXT_shader_implicit_conversions         , dummy_true                             ,  x ,  x ,  x ,  31, 2013)
 EXT(EXT_shader_integer_mix                  , EXT_shader_integer_mix                 , GLL, GLC,  x ,  30, 2013)
 EXT(EXT_shader_io_blocks                    , dummy_true                             ,  x ,  x ,  x ,  31, 2014)
 EXT(EXT_shader_samples_identical            , EXT_shader_samples_identical           , GLL, GLC,  x ,  31, 2015)