glsl: Add gl_Layer and gl_ViewportIndex builtins to fragment shader
authorChris Forbes <chrisf@ijw.co.nz>
Sat, 25 Jan 2014 05:29:38 +0000 (18:29 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Sun, 22 Jun 2014 04:52:19 +0000 (16:52 +1200)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/builtin_variables.cpp

index e22b08349b3e164b6717166b111b74b1be6611da..b9c69d23c7cce11b618d4b2508b2ec036d91029b 100644 (file)
@@ -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");
+   }
 }