Skip to content

Add ES 3.1 support #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/glsl/ast_to_hir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4623,6 +4623,8 @@ is_valid_default_precision_type(const struct glsl_type *const type)
/* "int" and "float" are valid, but vectors and matrices are not. */
return type->vector_elements == 1 && type->matrix_columns == 1;
case GLSL_TYPE_SAMPLER:
case GLSL_TYPE_IMAGE:
case GLSL_TYPE_ATOMIC_UINT:
return true;
default:
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/glsl/builtin_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ texture_array(const _mesa_glsl_parse_state *state)
static bool
texture_multisample(const _mesa_glsl_parse_state *state)
{
return state->is_version(150, 0) ||
return state->is_version(150, 310) ||
state->ARB_texture_multisample_enable;
}

Expand Down Expand Up @@ -298,7 +298,7 @@ texture_query_lod(const _mesa_glsl_parse_state *state)
static bool
texture_gather(const _mesa_glsl_parse_state *state)
{
return state->is_version(400, 0) ||
return state->is_version(400, 310) ||
state->ARB_texture_gather_enable ||
state->ARB_gpu_shader5_enable;
}
Expand All @@ -309,7 +309,7 @@ texture_gather(const _mesa_glsl_parse_state *state)
static bool
texture_gather_only(const _mesa_glsl_parse_state *state)
{
return !state->is_version(400, 0) &&
return !state->is_version(400, 310) &&
!state->ARB_gpu_shader5_enable &&
state->ARB_texture_gather_enable;
}
Expand Down Expand Up @@ -369,7 +369,7 @@ shader_trinary_minmax(const _mesa_glsl_parse_state *state)
static bool
shader_image_load_store(const _mesa_glsl_parse_state *state)
{
return (state->is_version(420, 0) ||
return (state->is_version(420, 310) ||
state->ARB_shader_image_load_store_enable);
}

Expand Down
32 changes: 16 additions & 16 deletions src/glsl/builtin_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const static struct builtin_type_versions {
T(samplerCubeArray, 400, 999)
T(sampler2DRect, 140, 999)
T(samplerBuffer, 140, 999)
T(sampler2DMS, 150, 999)
T(sampler2DMS, 150, 310)
T(sampler2DMSArray, 150, 999)

T(isampler1D, 130, 999)
Expand All @@ -179,7 +179,7 @@ const static struct builtin_type_versions {
T(isamplerCubeArray, 400, 999)
T(isampler2DRect, 140, 999)
T(isamplerBuffer, 140, 999)
T(isampler2DMS, 150, 999)
T(isampler2DMS, 150, 310)
T(isampler2DMSArray, 150, 999)

T(usampler1D, 130, 999)
Expand All @@ -191,7 +191,7 @@ const static struct builtin_type_versions {
T(usamplerCubeArray, 400, 999)
T(usampler2DRect, 140, 999)
T(usamplerBuffer, 140, 999)
T(usampler2DMS, 150, 999)
T(usampler2DMS, 150, 310)
T(usampler2DMSArray, 150, 999)

T(sampler1DShadow, 110, 999)
Expand All @@ -205,40 +205,40 @@ const static struct builtin_type_versions {
T(struct_gl_DepthRangeParameters, 110, 100)

T(image1D, 420, 999)
T(image2D, 420, 999)
T(image3D, 420, 999)
T(image2D, 420, 310)
T(image3D, 420, 310)
T(image2DRect, 420, 999)
T(imageCube, 420, 999)
T(imageCube, 420, 310)
T(imageBuffer, 420, 999)
T(image1DArray, 420, 999)
T(image2DArray, 420, 999)
T(image2DArray, 420, 310)
T(imageCubeArray, 420, 999)
T(image2DMS, 420, 999)
T(image2DMSArray, 420, 999)
T(iimage1D, 420, 999)
T(iimage2D, 420, 999)
T(iimage3D, 420, 999)
T(iimage2D, 420, 310)
T(iimage3D, 420, 310)
T(iimage2DRect, 420, 999)
T(iimageCube, 420, 999)
T(iimageCube, 420, 310)
T(iimageBuffer, 420, 999)
T(iimage1DArray, 420, 999)
T(iimage2DArray, 420, 999)
T(iimage2DArray, 420, 310)
T(iimageCubeArray, 420, 999)
T(iimage2DMS, 420, 999)
T(iimage2DMSArray, 420, 999)
T(uimage1D, 420, 999)
T(uimage2D, 420, 999)
T(uimage3D, 420, 999)
T(uimage2D, 420, 310)
T(uimage3D, 420, 310)
T(uimage2DRect, 420, 999)
T(uimageCube, 420, 999)
T(uimageCube, 420, 310)
T(uimageBuffer, 420, 999)
T(uimage1DArray, 420, 999)
T(uimage2DArray, 420, 999)
T(uimage2DArray, 420, 310)
T(uimageCubeArray, 420, 999)
T(uimage2DMS, 420, 999)
T(uimage2DMSArray, 420, 999)

T(atomic_uint, 420, 999)
T(atomic_uint, 420, 310)
};

const glsl_type *const deprecated_types[] = {
Expand Down
4 changes: 2 additions & 2 deletions src/glsl/builtin_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxTessEvaluationAtomicCounters", 0);
}

if (state->is_version(430, 0) || state->ARB_compute_shader_enable) {
if (state->is_version(430, 310) || state->ARB_compute_shader_enable) {
add_const_ivec3("gl_MaxComputeWorkGroupCount",
state->Const.MaxComputeWorkGroupCount[0],
state->Const.MaxComputeWorkGroupCount[1],
Expand Down Expand Up @@ -729,7 +729,7 @@ builtin_variable_generator::generate_constants()
*/
}

if (state->is_version(420, 0) ||
if (state->is_version(420, 310) ||
state->ARB_shader_image_load_store_enable) {
add_const("gl_MaxImageUnits",
state->Const.MaxImageUnits);
Expand Down
42 changes: 21 additions & 21 deletions src/glsl/glsl_lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2090,17 +2090,17 @@ KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY);
case 94:
YY_RULE_SETUP
#line 326 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS);
KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS);
YY_BREAK
case 95:
YY_RULE_SETUP
#line 327 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS);
KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS);
YY_BREAK
case 96:
YY_RULE_SETUP
#line 328 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS);
KEYWORD_WITH_ALT(150, 300, 150, 310, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS);
YY_BREAK
case 97:
YY_RULE_SETUP
Expand Down Expand Up @@ -2157,12 +2157,12 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 106:
YY_RULE_SETUP
#line 348 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IMAGE2D);
YY_BREAK
case 107:
YY_RULE_SETUP
#line 349 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE3D);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IMAGE3D);
YY_BREAK
case 108:
YY_RULE_SETUP
Expand All @@ -2172,7 +2172,7 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 109:
YY_RULE_SETUP
#line 351 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBE);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IMAGECUBE);
YY_BREAK
case 110:
YY_RULE_SETUP
Expand All @@ -2187,7 +2187,7 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 112:
YY_RULE_SETUP
#line 354 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DARRAY);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IMAGE2DARRAY);
YY_BREAK
case 113:
YY_RULE_SETUP
Expand All @@ -2212,12 +2212,12 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 117:
YY_RULE_SETUP
#line 359 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2D);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IIMAGE2D);
YY_BREAK
case 118:
YY_RULE_SETUP
#line 360 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE3D);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IIMAGE3D);
YY_BREAK
case 119:
YY_RULE_SETUP
Expand All @@ -2227,7 +2227,7 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 120:
YY_RULE_SETUP
#line 362 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBE);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBE);
YY_BREAK
case 121:
YY_RULE_SETUP
Expand All @@ -2242,7 +2242,7 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 123:
YY_RULE_SETUP
#line 365 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DARRAY);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DARRAY);
YY_BREAK
case 124:
YY_RULE_SETUP
Expand All @@ -2267,12 +2267,12 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 128:
YY_RULE_SETUP
#line 370 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2D);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, UIMAGE2D);
YY_BREAK
case 129:
YY_RULE_SETUP
#line 371 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE3D);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, UIMAGE3D);
YY_BREAK
case 130:
YY_RULE_SETUP
Expand All @@ -2282,7 +2282,7 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 131:
YY_RULE_SETUP
#line 373 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBE);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBE);
YY_BREAK
case 132:
YY_RULE_SETUP
Expand All @@ -2297,7 +2297,7 @@ KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable,
case 134:
YY_RULE_SETUP
#line 376 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DARRAY);
KEYWORD_WITH_ALT(130, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DARRAY);
YY_BREAK
case 135:
YY_RULE_SETUP
Expand Down Expand Up @@ -2337,32 +2337,32 @@ KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW);
case 142:
YY_RULE_SETUP
#line 385 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, COHERENT);
KEYWORD_WITH_ALT(420, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, COHERENT);
YY_BREAK
case 143:
YY_RULE_SETUP
#line 386 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(110, 100, 420, 0, yyextra->ARB_shader_image_load_store_enable, VOLATILE);
KEYWORD_WITH_ALT(110, 100, 420, 310, yyextra->ARB_shader_image_load_store_enable, VOLATILE);
YY_BREAK
case 144:
YY_RULE_SETUP
#line 387 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, RESTRICT);
KEYWORD_WITH_ALT(420, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, RESTRICT);
YY_BREAK
case 145:
YY_RULE_SETUP
#line 388 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, READONLY);
KEYWORD_WITH_ALT(420, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, READONLY);
YY_BREAK
case 146:
YY_RULE_SETUP
#line 389 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, WRITEONLY);
KEYWORD_WITH_ALT(420, 300, 420, 310, yyextra->ARB_shader_image_load_store_enable, WRITEONLY);
YY_BREAK
case 147:
YY_RULE_SETUP
#line 391 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT);
KEYWORD_WITH_ALT(420, 300, 420, 310, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT);
YY_BREAK
case 148:
YY_RULE_SETUP
Expand Down
Loading