From: Chris Forbes Date: Thu, 18 Jul 2013 10:41:21 +0000 (+1200) Subject: glsl: enable types for EXT_gpu_shader4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85fefd191340db55cd0a4560d5b05e4f876e00fd;p=mesa.git glsl: enable types for EXT_gpu_shader4 Reviewed-by: Timothy Arceri Tested-by: Dieter Nützel Reviewed-by: Ian Romanick Reviewed-by: Eric Anholt --- diff --git a/src/compiler/glsl/builtin_types.cpp b/src/compiler/glsl/builtin_types.cpp index d2bcdd68138..eee0205224f 100644 --- a/src/compiler/glsl/builtin_types.cpp +++ b/src/compiler/glsl/builtin_types.cpp @@ -324,6 +324,38 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) add_type(symbols, glsl_type::sampler2DRectShadow_type); } + if (state->EXT_gpu_shader4_enable) { + add_type(symbols, glsl_type::uint_type); + add_type(symbols, glsl_type::uvec2_type); + add_type(symbols, glsl_type::uvec3_type); + add_type(symbols, glsl_type::uvec4_type); + + add_type(symbols, glsl_type::sampler1DArray_type); + add_type(symbols, glsl_type::sampler2DArray_type); + add_type(symbols, glsl_type::sampler1DArrayShadow_type); + add_type(symbols, glsl_type::sampler2DArrayShadow_type); + add_type(symbols, glsl_type::samplerCubeShadow_type); + add_type(symbols, glsl_type::samplerBuffer_type); + + add_type(symbols, glsl_type::isampler1D_type); + add_type(symbols, glsl_type::isampler2D_type); + add_type(symbols, glsl_type::isampler3D_type); + add_type(symbols, glsl_type::isamplerCube_type); + add_type(symbols, glsl_type::isampler2DRect_type); + add_type(symbols, glsl_type::isampler1DArray_type); + add_type(symbols, glsl_type::isampler2DArray_type); + add_type(symbols, glsl_type::isamplerBuffer_type); + + add_type(symbols, glsl_type::usampler1D_type); + add_type(symbols, glsl_type::usampler2D_type); + add_type(symbols, glsl_type::usampler3D_type); + add_type(symbols, glsl_type::usamplerCube_type); + add_type(symbols, glsl_type::usampler2DRect_type); + add_type(symbols, glsl_type::usampler1DArray_type); + add_type(symbols, glsl_type::usampler2DArray_type); + add_type(symbols, glsl_type::usamplerBuffer_type); + } + if (state->EXT_texture_array_enable) { add_type(symbols, glsl_type::sampler1DArray_type); add_type(symbols, glsl_type::sampler2DArray_type); diff --git a/src/compiler/glsl/glsl_lexer.ll b/src/compiler/glsl/glsl_lexer.ll index d83e700f6fb..c5ec4fd896e 100644 --- a/src/compiler/glsl/glsl_lexer.ll +++ b/src/compiler/glsl/glsl_lexer.ll @@ -362,9 +362,9 @@ bvec4 { yylval->type = glsl_type::bvec4_type; return BASIC_TYPE_TOK; } ivec2 { yylval->type = glsl_type::ivec2_type; return BASIC_TYPE_TOK; } ivec3 { yylval->type = glsl_type::ivec3_type; return BASIC_TYPE_TOK; } ivec4 { yylval->type = glsl_type::ivec4_type; return BASIC_TYPE_TOK; } -uvec2 TYPE(130, 300, 130, 300, glsl_type::uvec2_type); -uvec3 TYPE(130, 300, 130, 300, glsl_type::uvec3_type); -uvec4 TYPE(130, 300, 130, 300, glsl_type::uvec4_type); +uvec2 TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::uvec2_type); +uvec3 TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::uvec3_type); +uvec4 TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::uvec4_type); vec2 { yylval->type = glsl_type::vec2_type; return BASIC_TYPE_TOK; } vec3 { yylval->type = glsl_type::vec3_type; return BASIC_TYPE_TOK; } vec4 { yylval->type = glsl_type::vec4_type; return BASIC_TYPE_TOK; } @@ -398,25 +398,25 @@ sampler1D DEPRECATED_ES_TYPE(glsl_type::sampler1D_type); sampler2D { yylval->type = glsl_type::sampler2D_type; return BASIC_TYPE_TOK; } sampler3D { yylval->type = glsl_type::sampler3D_type; return BASIC_TYPE_TOK; } samplerCube { yylval->type = glsl_type::samplerCube_type; return BASIC_TYPE_TOK; } -sampler1DArray TYPE(130, 300, 130, 0, glsl_type::sampler1DArray_type); -sampler2DArray TYPE(130, 300, 130, 300, glsl_type::sampler2DArray_type); +sampler1DArray TYPE_WITH_ALT(130, 300, 130, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::sampler1DArray_type); +sampler2DArray TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::sampler2DArray_type); sampler1DShadow DEPRECATED_ES_TYPE(glsl_type::sampler1DShadow_type); sampler2DShadow { yylval->type = glsl_type::sampler2DShadow_type; return BASIC_TYPE_TOK; } -samplerCubeShadow TYPE(130, 300, 130, 300, glsl_type::samplerCubeShadow_type); -sampler1DArrayShadow TYPE(130, 300, 130, 0, glsl_type::sampler1DArrayShadow_type); -sampler2DArrayShadow TYPE(130, 300, 130, 300, glsl_type::sampler2DArrayShadow_type); -isampler1D TYPE(130, 300, 130, 0, glsl_type::isampler1D_type); -isampler2D TYPE(130, 300, 130, 300, glsl_type::isampler2D_type); -isampler3D TYPE(130, 300, 130, 300, glsl_type::isampler3D_type); -isamplerCube TYPE(130, 300, 130, 300, glsl_type::isamplerCube_type); -isampler1DArray TYPE(130, 300, 130, 0, glsl_type::isampler1DArray_type); -isampler2DArray TYPE(130, 300, 130, 300, glsl_type::isampler2DArray_type); -usampler1D TYPE(130, 300, 130, 0, glsl_type::usampler1D_type); -usampler2D TYPE(130, 300, 130, 300, glsl_type::usampler2D_type); -usampler3D TYPE(130, 300, 130, 300, glsl_type::usampler3D_type); -usamplerCube TYPE(130, 300, 130, 300, glsl_type::usamplerCube_type); -usampler1DArray TYPE(130, 300, 130, 0, glsl_type::usampler1DArray_type); -usampler2DArray TYPE(130, 300, 130, 300, glsl_type::usampler2DArray_type); +samplerCubeShadow TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::samplerCubeShadow_type); +sampler1DArrayShadow TYPE_WITH_ALT(130, 300, 130, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::sampler1DArrayShadow_type); +sampler2DArrayShadow TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::sampler2DArrayShadow_type); +isampler1D TYPE_WITH_ALT(130, 300, 130, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::isampler1D_type); +isampler2D TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::isampler2D_type); +isampler3D TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::isampler3D_type); +isamplerCube TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::isamplerCube_type); +isampler1DArray TYPE_WITH_ALT(130, 300, 130, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::isampler1DArray_type); +isampler2DArray TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::isampler2DArray_type); +usampler1D TYPE_WITH_ALT(130, 300, 130, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::usampler1D_type); +usampler2D TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::usampler2D_type); +usampler3D TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::usampler3D_type); +usamplerCube TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::usamplerCube_type); +usampler1DArray TYPE_WITH_ALT(130, 300, 130, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::usampler1DArray_type); +usampler2DArray TYPE_WITH_ALT(130, 300, 130, 300, yyextra->EXT_gpu_shader4_enable, glsl_type::usampler2DArray_type); /* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */ /* these are reserved but not defined in GLSL 3.00 */ @@ -656,15 +656,15 @@ common KEYWORD(130, 300, 0, 0, COMMON); partition KEYWORD(130, 300, 0, 0, PARTITION); active KEYWORD(130, 300, 0, 0, ACTIVE); superp KEYWORD(130, 100, 0, 0, SUPERP); -samplerBuffer TYPE_WITH_ALT(130, 300, 140, 320, yyextra->EXT_texture_buffer_enable || yyextra->OES_texture_buffer_enable, glsl_type::samplerBuffer_type); +samplerBuffer TYPE_WITH_ALT(130, 300, 140, 320, yyextra->EXT_texture_buffer_enable || yyextra->OES_texture_buffer_enable || yyextra->EXT_gpu_shader4_enable, glsl_type::samplerBuffer_type); filter KEYWORD(130, 300, 0, 0, FILTER); row_major KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR); /* Additional reserved words in GLSL 1.40 */ -isampler2DRect TYPE(140, 300, 140, 0, glsl_type::isampler2DRect_type); -usampler2DRect TYPE(140, 300, 140, 0, glsl_type::usampler2DRect_type); -isamplerBuffer TYPE_WITH_ALT(140, 300, 140, 320, yyextra->EXT_texture_buffer_enable || yyextra->OES_texture_buffer_enable, glsl_type::isamplerBuffer_type); -usamplerBuffer TYPE_WITH_ALT(140, 300, 140, 320, yyextra->EXT_texture_buffer_enable || yyextra->OES_texture_buffer_enable, glsl_type::usamplerBuffer_type); +isampler2DRect TYPE_WITH_ALT(140, 300, 140, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::isampler2DRect_type); +usampler2DRect TYPE_WITH_ALT(140, 300, 140, 0, yyextra->EXT_gpu_shader4_enable, glsl_type::usampler2DRect_type); +isamplerBuffer TYPE_WITH_ALT(140, 300, 140, 320, yyextra->EXT_texture_buffer_enable || yyextra->OES_texture_buffer_enable || yyextra->EXT_gpu_shader4_enable, glsl_type::isamplerBuffer_type); +usamplerBuffer TYPE_WITH_ALT(140, 300, 140, 320, yyextra->EXT_texture_buffer_enable || yyextra->OES_texture_buffer_enable || yyextra->EXT_gpu_shader4_enable, glsl_type::usamplerBuffer_type); /* Additional reserved words in GLSL ES 3.00 */ resource KEYWORD(420, 300, 0, 0, RESOURCE);