diff options
author | Ian Romanick <[email protected]> | 2016-05-23 14:34:24 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-08-26 15:03:14 -0700 |
commit | 3a0ae7b55c4c38b9d0a37aa2a741da18c33f49fe (patch) | |
tree | 68dd864a7a20c8fa637dbce053a029ab3b0b5c53 /src | |
parent | 1a72fbf9e6743368dc8e7664adf095af8ec5b6d8 (diff) |
glsl: Allow gl_InvocationID and gl_Layer with GL_OES_geometry_shader
Fixes
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_2d_array
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_2d_multisample_array
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_3d
dEQP-GLES31.functional.geometry_shading.layered.fragment_layer_cubemap
v2: Don't enable gl_ViewportIndex in GLSL ES 3.20. Noticed by Ilia.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/builtin_variables.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index d4ea6607b46..d379de66030 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -1078,8 +1078,10 @@ builtin_variable_generator::generate_gs_special_vars() var = add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex"); var->data.interpolation = INTERP_MODE_FLAT; } - if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable) + if (state->is_version(400, 320) || state->ARB_gpu_shader5_enable || + state->OES_geometry_shader_enable || state->EXT_geometry_shader_enable) { add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID"); + } /* Although gl_PrimitiveID appears in tessellation control and tessellation * evaluation shaders, it has a different function there than it has in @@ -1198,9 +1200,16 @@ builtin_variable_generator::generate_fs_special_vars() add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn"); } - if (state->is_version(430, 0) || state->ARB_fragment_layer_viewport_enable) { + if (state->is_version(430, 320) || + state->ARB_fragment_layer_viewport_enable || + state->OES_geometry_shader_enable || + state->EXT_geometry_shader_enable) { var = add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer"); var->data.interpolation = INTERP_MODE_FLAT; + } + + if (state->is_version(430, 0) || + state->ARB_fragment_layer_viewport_enable) { var = add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex"); var->data.interpolation = INTERP_MODE_FLAT; } |