nir: Allow using nir_lower_io_to_scalar_early on VS input vars.
authorEric Anholt <eric@anholt.net>
Tue, 18 Sep 2018 17:35:34 +0000 (10:35 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 30 Oct 2018 17:46:52 +0000 (10:46 -0700)
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).

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir_lower_io_to_scalar.c

index 2b98e298cce4d1048d094c2bc5c71b299263fc2f..929761fa888394dda92ce96a4d2eec0ac7232f37 100644 (file)
@@ -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;