[Mesa-dev] [PATCH] nir: Allow using nir_lower_io_to_scalar_early on VS input vars.

Eric Anholt eric at anholt.net
Tue Oct 16 00:18:53 UTC 2018


This will be used on V3D to cut down the size of the VS inputs in the VPM
(memory area for sharing data between shader stages).
---
 src/compiler/nir/nir_lower_io_to_scalar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_io_to_scalar.c b/src/compiler/nir/nir_lower_io_to_scalar.c
index f0c2a6a95d6d..c64f641a0ae4 100644
--- a/src/compiler/nir/nir_lower_io_to_scalar.c
+++ b/src/compiler/nir/nir_lower_io_to_scalar.c
@@ -320,7 +320,9 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask)
                if (glsl_type_is_64bit(glsl_without_array(var->type)))
                   continue;
 
-               if (var->data.location < VARYING_SLOT_VAR0 &&
+               if (!(shader->info.stage == MESA_SHADER_VERTEX &&
+                     mode == nir_var_shader_in) &&
+                   var->data.location < VARYING_SLOT_VAR0 &&
                    var->data.location >= 0)
                   continue;
 
-- 
2.18.0



More information about the mesa-dev mailing list