[Mesa-dev] [PATCH 05/20] glsl: Add extension plumbing and define for ARB_shader_subroutine

Ilia Mirkin imirkin at alum.mit.edu
Mon Jul 20 22:29:23 PDT 2015


I could be missing it, but does anything restrict the availability of
this define to core contexts? I believe you have comparable issues
elsewhere in the change (where you only look at the extension being
enabled vs also looking at the API).

On Tue, Jul 21, 2015 at 1:19 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Chris Forbes <chrisf at ijw.co.nz>
>
> Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/glsl/glcpp/glcpp-parse.y        | 3 +++
>  src/glsl/glsl_parser_extras.cpp     | 1 +
>  src/glsl/glsl_parser_extras.h       | 2 ++
>  src/glsl/standalone_scaffolding.cpp | 1 +
>  4 files changed, 7 insertions(+)
>
> diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
> index ed1bffb..5534ff7 100644
> --- a/src/glsl/glcpp/glcpp-parse.y
> +++ b/src/glsl/glcpp/glcpp-parse.y
> @@ -2486,6 +2486,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
>
>               if (extensions->ARB_shader_storage_buffer_object)
>                  add_builtin_define(parser, "GL_ARB_shader_storage_buffer_object", 1);
> +
> +              if (extensions->ARB_shader_subroutine)
> +                 add_builtin_define(parser, "GL_ARB_shader_subroutine", 1);
>            }
>         }
>
> diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
> index 5412f0b..a234eef 100644
> --- a/src/glsl/glsl_parser_extras.cpp
> +++ b/src/glsl/glsl_parser_extras.cpp
> @@ -571,6 +571,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
>     EXT(ARB_shader_precision,             true,  false,     ARB_shader_precision),
>     EXT(ARB_shader_stencil_export,        true,  false,     ARB_shader_stencil_export),
>     EXT(ARB_shader_storage_buffer_object, true,  false,     ARB_shader_storage_buffer_object),
> +   EXT(ARB_shader_subroutine,            true,  false,     ARB_shader_subroutine),
>     EXT(ARB_shader_texture_lod,           true,  false,     ARB_shader_texture_lod),
>     EXT(ARB_shading_language_420pack,     true,  false,     ARB_shading_language_420pack),
>     EXT(ARB_shading_language_packing,     true,  false,     ARB_shading_language_packing),
> diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
> index 4996b84..dd441c1 100644
> --- a/src/glsl/glsl_parser_extras.h
> +++ b/src/glsl/glsl_parser_extras.h
> @@ -469,6 +469,8 @@ struct _mesa_glsl_parse_state {
>     bool ARB_shader_stencil_export_warn;
>     bool ARB_shader_storage_buffer_object_enable;
>     bool ARB_shader_storage_buffer_object_warn;
> +   bool ARB_shader_subroutine_enable;
> +   bool ARB_shader_subroutine_warn;
>     bool ARB_shader_texture_lod_enable;
>     bool ARB_shader_texture_lod_warn;
>     bool ARB_shading_language_420pack_enable;
> diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
> index 172c6f4..15546c2 100644
> --- a/src/glsl/standalone_scaffolding.cpp
> +++ b/src/glsl/standalone_scaffolding.cpp
> @@ -133,6 +133,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
>     ctx->Extensions.ARB_sample_shading = true;
>     ctx->Extensions.ARB_shader_bit_encoding = true;
>     ctx->Extensions.ARB_shader_stencil_export = true;
> +   ctx->Extensions.ARB_shader_subroutine = true;
>     ctx->Extensions.ARB_shader_texture_lod = true;
>     ctx->Extensions.ARB_shading_language_420pack = true;
>     ctx->Extensions.ARB_shading_language_packing = true;
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list