[Mesa-dev] [PATCH 2/5] mesa, glsl: add support for EXT_shader_image_load_formatted
Ilia Mirkin
imirkin at alum.mit.edu
Fri Jun 15 20:31:54 UTC 2018
On Fri, Jun 15, 2018 at 4:24 PM, Rhys Perry <pendingchaos02 at gmail.com> wrote:
> Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
> ---
> src/compiler/glsl/ast_to_hir.cpp | 5 +++++
> src/compiler/glsl/glsl_parser_extras.cpp | 1 +
> src/compiler/glsl/glsl_parser_extras.h | 7 +++++++
> src/mesa/main/extensions_table.h | 1 +
> src/mesa/main/mtypes.h | 1 +
> 5 files changed, 15 insertions(+)
>
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index dd60a2a87f..09ce5a44e6 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -3461,6 +3461,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");
I'm confused by this. IIRC the warn stuff is so that you get a warning
when you try to enable an ext that's not available (the options are
"enable", "warn", and "require" -- the latter fails the compile while
the first two allow you to handle it with #ifdef GL_EXT_foo).
> + }
> } else {
> if (var->data.mode == ir_var_uniform) {
> if (state->es_shader) {
> diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
> index 04eba980e0..187bc0f18e 100644
> --- a/src/compiler/glsl/glsl_parser_extras.cpp
> +++ b/src/compiler/glsl/glsl_parser_extras.cpp
> @@ -714,6 +714,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_integer_mix),
> EXT_AEP(EXT_shader_io_blocks),
> EXT(EXT_shader_samples_identical),
> diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
> index 59a173418b..2818cdbb07 100644
> --- a/src/compiler/glsl/glsl_parser_extras.h
> +++ b/src/compiler/glsl/glsl_parser_extras.h
> @@ -343,6 +343,11 @@ struct _mesa_glsl_parse_state {
> return ARB_bindless_texture_enable;
> }
>
> + bool has_image_load_formatted() const
> + {
> + return EXT_shader_image_load_formatted_enable;
> + }
> +
> void process_version_directive(YYLTYPE *locp, int version,
> const char *ident);
>
> @@ -790,6 +795,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_integer_mix_enable;
> bool EXT_shader_integer_mix_warn;
> bool EXT_shader_io_blocks_enable;
> diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
> index 79ef228b69..ac6acbb5ad 100644
> --- a/src/mesa/main/extensions_table.h
> +++ b/src/mesa/main/extensions_table.h
> @@ -254,6 +254,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_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)
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 482c42a4b2..4d0fdfe8e7 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -4179,6 +4179,7 @@ struct gl_extensions
> GLboolean EXT_provoking_vertex;
> 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_stencil_two_side;
> --
> 2.14.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list