glsl: Add gl_ViewportIndex built-in variable
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Wed, 13 Nov 2013 18:11:39 +0000 (11:11 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 20 Jan 2014 19:32:00 +0000 (11:32 -0800)
v2 (idr): Fix copy-and-paste bug... s/LAYER/VIEWPORT/

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/builtin_variables.cpp

index f630923eda4ded1afac974ba137920dc59533606..d6bc3c073169d2e5fd7fb6f9376a9a5c05dd05f5 100644 (file)
@@ -780,6 +780,8 @@ void
 builtin_variable_generator::generate_gs_special_vars()
 {
    add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
+   if (state->ARB_viewport_array_enable)
+      add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
 
    /* Although gl_PrimitiveID appears in tessellation control and tessellation
     * evaluation shaders, it has a different function there than it has in