[Mesa-dev] [PATCH v2 3/4] glsl: add support for OES_texture_storage_multisample_2d_array
Matt Turner
mattst88 at gmail.com
Wed Aug 26 21:30:38 PDT 2015
On Wed, Aug 26, 2015 at 8:40 PM, Tapani Pälli <tapani.palli at intel.com> wrote:
> v2: use ARB_texture_multisample enable bit
>
> Patch adds extension enable bit and enables required keywords
> and builtin functions for the extension.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
> src/glsl/builtin_functions.cpp | 5 +++--
> src/glsl/builtin_types.cpp | 3 ++-
> src/glsl/glcpp/glcpp-parse.y | 2 ++
> src/glsl/glsl_lexer.ll | 6 +++---
> src/glsl/glsl_parser_extras.cpp | 1 +
> src/glsl/glsl_parser_extras.h | 2 ++
> 6 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
> index 1bc3de4..4092d68 100644
> --- a/src/glsl/builtin_functions.cpp
> +++ b/src/glsl/builtin_functions.cpp
> @@ -284,8 +284,9 @@ texture_multisample(const _mesa_glsl_parse_state *state)
> static bool
> texture_multisample_array(const _mesa_glsl_parse_state *state)
> {
> - return state->is_version(150, 0) ||
> - state->ARB_texture_multisample_enable;
> + return state->is_version(150, 320) ||
> + state->ARB_texture_multisample_enable ||
> + state->OES_texture_storage_multisample_2d_array_enable;
> }
>
> static bool
> diff --git a/src/glsl/builtin_types.cpp b/src/glsl/builtin_types.cpp
> index 9cf198f..0d0d71d 100644
> --- a/src/glsl/builtin_types.cpp
> +++ b/src/glsl/builtin_types.cpp
> @@ -307,7 +307,8 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
> add_type(symbols, glsl_type::usamplerCubeArray_type);
> }
>
> - if (state->ARB_texture_multisample_enable) {
> + if (state->ARB_texture_multisample_enable ||
> + state->OES_texture_storage_multisample_2d_array_enable) {
> add_type(symbols, glsl_type::sampler2DMS_type);
> add_type(symbols, glsl_type::isampler2DMS_type);
> add_type(symbols, glsl_type::usampler2DMS_type);
> diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
> index 18e50af..2d631f0 100644
> --- a/src/glsl/glcpp/glcpp-parse.y
> +++ b/src/glsl/glcpp/glcpp-parse.y
> @@ -2382,6 +2382,8 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
> add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
> if (extensions->OES_standard_derivatives)
> add_builtin_define(parser, "GL_OES_standard_derivatives", 1);
> + if (extensions->ARB_texture_multisample)
> + add_builtin_define(parser, "GL_OES_texture_storage_multisample_2d_array", 1);
> }
> } else {
> add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
> diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
> index 24998c1..9d7ad74 100644
> --- a/src/glsl/glsl_lexer.ll
> +++ b/src/glsl/glsl_lexer.ll
> @@ -347,9 +347,9 @@ usampler2DArray KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY);
> sampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS);
> isampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS);
> usampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS);
> -sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY);
> -isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY);
> -usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY);
> +sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, yyextra->ARB_texture_multisample_enable||yyextra->OES_texture_storage_multisample_2d_array_enable, SAMPLER2DMSARRAY);
> +isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, yyextra->ARB_texture_multisample_enable||yyextra->OES_texture_storage_multisample_2d_array_enable, ISAMPLER2DMSARRAY);
> +usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 320, yyextra->ARB_texture_multisample_enable||yyextra-
Spaces around operators.
More information about the mesa-dev
mailing list