From b2c1f3a0198d2abf98e965a7a022ad8c9ec4f43c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 25 Jan 2014 18:29:38 +1300 Subject: [PATCH] glsl: Add gl_Layer and gl_ViewportIndex builtins to fragment shader Signed-off-by: Chris Forbes Reviewed-by: Ian Romanick --- src/glsl/builtin_variables.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp index e22b08349b3..b9c69d23c7c 100644 --- a/src/glsl/builtin_variables.cpp +++ b/src/glsl/builtin_variables.cpp @@ -938,6 +938,11 @@ builtin_variable_generator::generate_fs_special_vars() if (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) { + add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer"); + add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex"); + } } -- 2.30.2