diff options
author | Marek Olšák <[email protected]> | 2018-08-07 18:30:19 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-04-24 20:45:15 -0400 |
commit | 7004114102332acbf899c1bd291240d357d29e7c (patch) | |
tree | 6061d6a14b83624541335332b65b9e2095d59b23 /src/compiler/glsl/builtin_variables.cpp | |
parent | 1a973aa5e167c4ac4a7e83d67a4fa3a9a42efd8e (diff) |
glsl: add builtin variables for EXT_gpu_shader4
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/glsl/builtin_variables.cpp')
-rw-r--r-- | src/compiler/glsl/builtin_variables.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index 78fccc4e195..17ee80cd419 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -1009,7 +1009,7 @@ builtin_variable_generator::generate_vs_special_vars() { ir_variable *var; - if (state->is_version(130, 300)) + if (state->is_version(130, 300) || state->EXT_gpu_shader4_enable) add_system_value(SYSTEM_VALUE_VERTEX_ID, int_t, "gl_VertexID"); if (state->is_version(460, 0)) { add_system_value(SYSTEM_VALUE_BASE_VERTEX, int_t, "gl_BaseVertex"); @@ -1018,7 +1018,8 @@ builtin_variable_generator::generate_vs_special_vars() } if (state->ARB_draw_instanced_enable) add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDARB"); - if (state->ARB_draw_instanced_enable || state->is_version(140, 300)) + if (state->ARB_draw_instanced_enable || state->is_version(140, 300) || + state->EXT_gpu_shader4_enable) add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceID"); if (state->ARB_shader_draw_parameters_enable) { add_system_value(SYSTEM_VALUE_BASE_VERTEX, int_t, "gl_BaseVertexARB"); @@ -1171,7 +1172,7 @@ builtin_variable_generator::generate_fs_special_vars() if (state->is_version(120, 100)) add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord"); - if (state->has_geometry_shader()) { + if (state->has_geometry_shader() || state->EXT_gpu_shader4_enable) { var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID"); var->data.interpolation = INTERP_MODE_FLAT; } |