[Mesa-dev] [PATCH 1/8] glsl: Add infrastructure for ARB_shading_language_packing

Ian Romanick idr at freedesktop.org
Fri Jan 25 06:27:43 PST 2013


On 01/24/2013 10:47 PM, Matt Turner wrote:
> ---
>   src/glsl/builtins/tools/generate_builtins.py |    1 +
>   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 +
>   src/mesa/main/extensions.c                   |    1 +
>   src/mesa/main/mtypes.h                       |    1 +
>   7 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
> index 2cfb1a3..3db862e 100755
> --- a/src/glsl/builtins/tools/generate_builtins.py
> +++ b/src/glsl/builtins/tools/generate_builtins.py
> @@ -189,6 +189,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
>      st->OES_EGL_image_external_enable = true;
>      st->ARB_shader_bit_encoding_enable = true;
>      st->ARB_texture_cube_map_array_enable = true;
> +   st->ARB_shading_language_packing_enable = true;
>      _mesa_glsl_initialize_types(st);
>
>      sh->ir = new(sh) exec_list;
> diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
> index 8fba923..e927c7c 100644
> --- a/src/glsl/glcpp/glcpp-parse.y
> +++ b/src/glsl/glcpp/glcpp-parse.y
> @@ -1227,6 +1227,9 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
>
>   	      if (extensions->ARB_texture_cube_map_array)
>   	         add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
> +
> +	      if (extensions->ARB_shading_language_packing)
> +	         add_builtin_define(parser, "GL_ARB_shading_language_packing", 1);
>   	   }
>   	}
>
> diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
> index b460c86..c8dbc89 100644
> --- a/src/glsl/glsl_parser_extras.cpp
> +++ b/src/glsl/glsl_parser_extras.cpp
> @@ -462,6 +462,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
>      EXT(ARB_uniform_buffer_object,      true,  false, true,  true,  false,     ARB_uniform_buffer_object),
>      EXT(OES_standard_derivatives,       false, false, true,  false,  true,     OES_standard_derivatives),
>      EXT(ARB_texture_cube_map_array,     true,  false, true,  true,  false,     ARB_texture_cube_map_array),
> +   EXT(ARB_shading_language_packing,   true,  false, true,  true,  false,     ARB_shading_language_packing),

This array should be sorted...

>   };
>
>   #undef EXT
> diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
> index 2e6bb0b..53df149 100644
> --- a/src/glsl/glsl_parser_extras.h
> +++ b/src/glsl/glsl_parser_extras.h
> @@ -272,6 +272,8 @@ struct _mesa_glsl_parse_state {
>      bool OES_standard_derivatives_warn;
>      bool ARB_texture_cube_map_array_enable;
>      bool ARB_texture_cube_map_array_warn;
> +   bool ARB_shading_language_packing_enable;
> +   bool ARB_shading_language_packing_warn;
>      /*@}*/
>
>      /** Extensions supported by the OpenGL implementation. */
> diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
> index ccf5b4f..8b12f81 100644
> --- a/src/glsl/standalone_scaffolding.cpp
> +++ b/src/glsl/standalone_scaffolding.cpp
> @@ -101,6 +101,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
>      ctx->Extensions.ARB_shader_bit_encoding = true;
>      ctx->Extensions.OES_standard_derivatives = true;
>      ctx->Extensions.ARB_texture_cube_map_array = true;
> +   ctx->Extensions.ARB_shading_language_packing = true;
>
>      ctx->Const.GLSLVersion = 120;
>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index fd25d31..fb41760 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -125,6 +125,7 @@ static const struct extension extension_table[] = {
>      { "GL_ARB_shader_stencil_export",               o(ARB_shader_stencil_export),               GL,             2009 },
>      { "GL_ARB_shader_texture_lod",                  o(ARB_shader_texture_lod),                  GL,             2009 },
>      { "GL_ARB_shading_language_100",                o(ARB_shading_language_100),                GLL,            2003 },
> +   { "GL_ARB_shading_language_packing",            o(ARB_shading_language_packing),            GL,             2011 },
>      { "GL_ARB_shadow",                              o(ARB_shadow),                              GLL,            2001 },
>      { "GL_ARB_sync",                                o(ARB_sync),                                GL,             2003 },
>      { "GL_ARB_texture_border_clamp",                o(ARB_texture_border_clamp),                GLL,            2000 },
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index cba1e16..254679f 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3042,6 +3042,7 @@ struct gl_extensions
>      GLboolean ARB_shader_stencil_export;
>      GLboolean ARB_shader_texture_lod;
>      GLboolean ARB_shading_language_100;
> +   GLboolean ARB_shading_language_packing;
>      GLboolean ARB_shadow;
>      GLboolean ARB_sync;
>      GLboolean ARB_texture_border_clamp;
>



More information about the mesa-dev mailing list