summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2015-06-17 15:09:26 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2015-06-18 13:21:44 -0400
commitb6e238023c4f8af2328dc3bcab1d73a3e19f4fbb (patch)
treed0f51bb12cca694efd9af825189dcc6a04012ff9 /src/glsl/builtin_variables.cpp
parentc40e7ee7c47cb24264fd77ef37fab99dea4c299a (diff)
downloadexternal_mesa3d-b6e238023c4f8af2328dc3bcab1d73a3e19f4fbb.zip
external_mesa3d-b6e238023c4f8af2328dc3bcab1d73a3e19f4fbb.tar.gz
external_mesa3d-b6e238023c4f8af2328dc3bcab1d73a3e19f4fbb.tar.bz2
glsl: add version checks to conditionals for builtin variable enablement
A number of builtin variables have checks based on the extension being enabled, but were missing enablement via a higher GLSL version. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/glsl/builtin_variables.cpp')
-rw-r--r--src/glsl/builtin_variables.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 6806aa1..c52b252 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -876,9 +876,9 @@ void
builtin_variable_generator::generate_gs_special_vars()
{
add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
- if (state->ARB_viewport_array_enable)
+ if (state->is_version(410, 0) || state->ARB_viewport_array_enable)
add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
- if (state->ARB_gpu_shader5_enable)
+ if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable)
add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID");
/* Although gl_PrimitiveID appears in tessellation control and tessellation
@@ -946,7 +946,7 @@ builtin_variable_generator::generate_fs_special_vars()
var->enable_extension_warning("GL_AMD_shader_stencil_export");
}
- if (state->ARB_sample_shading_enable) {
+ if (state->is_version(400, 0) || state->ARB_sample_shading_enable) {
add_system_value(SYSTEM_VALUE_SAMPLE_ID, int_t, "gl_SampleID");
add_system_value(SYSTEM_VALUE_SAMPLE_POS, vec2_t, "gl_SamplePosition");
/* From the ARB_sample_shading specification:
@@ -959,11 +959,11 @@ builtin_variable_generator::generate_fs_special_vars()
add_output(FRAG_RESULT_SAMPLE_MASK, array(int_t, 1), "gl_SampleMask");
}
- if (state->ARB_gpu_shader5_enable) {
+ if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable) {
add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn");
}
- if (state->ARB_fragment_layer_viewport_enable) {
+ if (state->is_version(430, 0) || state->ARB_fragment_layer_viewport_enable) {
add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer");
add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
}