[Mesa-dev] [PATCH 3/3] glsl: expose gl_Layer in fs for ES 3.20 + exts

Ilia Mirkin imirkin at alum.mit.edu
Tue May 24 00:59:20 UTC 2016


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/compiler/glsl/builtin_variables.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index e082572..d78ac88 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1178,9 +1178,13 @@ builtin_variable_generator::generate_fs_special_vars()
       add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn");
    }
 
-   if (state->is_version(430, 0) || state->ARB_fragment_layer_viewport_enable) {
+   if (state->is_version(430, 320) || state->ARB_fragment_layer_viewport_enable ||
+       state->EXT_geometry_shader_enable || state->OES_geometry_shader_enable) {
       var = add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer");
       var->data.interpolation = INTERP_QUALIFIER_FLAT;
+   }
+
+   if (state->is_version(430, 0) || state->ARB_fragment_layer_viewport_enable) {
       var = add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
       var->data.interpolation = INTERP_QUALIFIER_FLAT;
    }
-- 
2.7.3



More information about the mesa-dev mailing list