Mesa (master): nir: Allow using nir_lower_io_to_scalar_early on VS input vars.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 30 17:58:28 UTC 2018


Module: Mesa
Branch: master
Commit: 8265dfaa87ef3b46288afdccae86221203c9b44e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8265dfaa87ef3b46288afdccae86221203c9b44e

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 18 10:35:34 2018 -0700

nir: Allow using nir_lower_io_to_scalar_early on VS input vars.

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 at itsqueeze.com>

---

 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 2b98e298cc..929761fa88 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;
 




More information about the mesa-commit mailing list