mesa, glsl: add support for EXT_shader_image_load_formatted
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 16 Jan 2019 23:18:26 +0000 (23:18 +0000)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 15 Apr 2019 20:18:07 +0000 (16:18 -0400)
v3: rebase

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/compiler/glsl/ast_to_hir.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 7d927dc4b8034e8b57ba83bedd2eee179359ba67..069231d44a87a12bdbfc1e2923abd22cd75ea1f1 100644 (file)
@@ -3476,6 +3476,11 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
       }
 
       var->data.image_format = qual->image_format;
+   } else if (state->has_image_load_formatted()) {
+      if (var->data.mode == ir_var_uniform &&
+          state->EXT_shader_image_load_formatted_warn) {
+         _mesa_glsl_warning(loc, state, "GL_EXT_image_load_formatted used");
+      }
    } else {
       if (var->data.mode == ir_var_uniform) {
          if (state->es_shader) {
index c1c3c9649fe363f5d2e2f110a273d7c068d3362d..0ffad2d25a0b314a4f666da939adee131e030f5a 100644 (file)
@@ -721,6 +721,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_image_load_formatted),
    EXT(EXT_shader_implicit_conversions),
    EXT(EXT_shader_integer_mix),
    EXT_AEP(EXT_shader_io_blocks),
index 82a2ce3424be2a171db07981b9f2b4bbbdd66ba3..8646ba6caddaee952e5c022610ed57aed6843327 100644 (file)
@@ -344,6 +344,11 @@ struct _mesa_glsl_parse_state {
       return ARB_bindless_texture_enable;
    }
 
+   bool has_image_load_formatted() const
+   {
+      return EXT_shader_image_load_formatted_enable;
+   }
+
    bool has_implicit_conversions() const
    {
       return EXT_shader_implicit_conversions_enable || is_version(120, 0);
@@ -822,6 +827,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_image_load_formatted_enable;
+   bool EXT_shader_image_load_formatted_warn;
    bool EXT_shader_implicit_conversions_enable;
    bool EXT_shader_implicit_conversions_warn;
    bool EXT_shader_integer_mix_enable;
index 549676a053d99bef61b5f761207aa063436b0af1..3077068dd80a26846d6b065ca61e6f72b06da396 100644 (file)
@@ -268,6 +268,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_image_load_formatted         , EXT_shader_image_load_formatted        , GLL, GLC,  x ,  x , 2014)
 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)
index 6f9c74bdfb03038263f44e156cefb8646d328bd3..297d3be8098a53e91b8dac439f0c57984f694f52 100644 (file)
@@ -4275,6 +4275,7 @@ struct gl_extensions
    GLboolean EXT_render_snorm;
    GLboolean EXT_semaphore;
    GLboolean EXT_semaphore_fd;
+   GLboolean EXT_shader_image_load_formatted;
    GLboolean EXT_shader_integer_mix;
    GLboolean EXT_shader_samples_identical;
    GLboolean EXT_sRGB;