[Mesa-dev] [PATCH 07/12] glsl: Add gl_Layer and gl_ViewportIndex builtins to fragment shader

Chris Forbes chrisf at ijw.co.nz
Fri Jan 24 22:51:55 PST 2014


Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 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 d6bc3c0..bb499fa 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -864,6 +864,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");
+   }
 }
 
 
-- 
1.8.5.3



More information about the mesa-dev mailing list