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

Tapani Pälli tapani.palli at intel.com
Thu Apr 23 22:19:36 PDT 2015


Patches 1,3,4,5 (and 2 with the changes mentioned);

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

(I'll continue on this a bit later.)

On 04/24/2015 04:42 AM, Dave Airlie wrote:
> From: Chris Forbes <chrisf at ijw.co.nz>
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>   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 c2f5223..c548ed2 100644
> --- a/src/glsl/glcpp/glcpp-parse.y
> +++ b/src/glsl/glcpp/glcpp-parse.y
> @@ -2480,6 +2480,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
>
>                 if (extensions->ARB_shader_precision)
>                    add_builtin_define(parser, "GL_ARB_shader_precision", 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 0aa3c54..237c2ad 100644
> --- a/src/glsl/glsl_parser_extras.cpp
> +++ b/src/glsl/glsl_parser_extras.cpp
> @@ -555,6 +555,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
>      EXT(ARB_shader_image_load_store,    true,  false,     ARB_shader_image_load_store),
>      EXT(ARB_shader_precision,           true,  false,     ARB_shader_precision),
>      EXT(ARB_shader_stencil_export,      true,  false,     ARB_shader_stencil_export),
> +   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 dae7864..1d3da44 100644
> --- a/src/glsl/glsl_parser_extras.h
> +++ b/src/glsl/glsl_parser_extras.h
> @@ -438,6 +438,8 @@ struct _mesa_glsl_parse_state {
>      bool ARB_shader_precision_warn;
>      bool ARB_shader_stencil_export_enable;
>      bool ARB_shader_stencil_export_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 a109c4e..62c2ff5 100644
> --- a/src/glsl/standalone_scaffolding.cpp
> +++ b/src/glsl/standalone_scaffolding.cpp
> @@ -132,6 +132,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;
>


More information about the mesa-dev mailing list