[Mesa-dev] [PATCH 5/7] i965/nir: Add a nir_lower_uniforms helper

Jason Ekstrand jason at jlekstrand.net
Mon Nov 23 18:11:44 PST 2015


This matches what we're already doing for inputs and outputs
---
 src/mesa/drivers/dri/i965/brw_nir.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 91358d8..e602df7 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -171,6 +171,14 @@ brw_nir_lower_outputs(nir_shader *nir, bool is_scalar)
    }
 }
 
+static void
+brw_nir_lower_uniforms(nir_shader *nir, bool is_scalar)
+{
+   nir_assign_var_locations(&nir->uniforms,
+                            &nir->num_uniforms,
+                            is_scalar ? type_size_scalar : type_size_vec4);
+}
+
 static bool
 should_clone_nir()
 {
@@ -298,6 +306,7 @@ brw_lower_nir(nir_shader *nir,
 
    OPT_V(brw_nir_lower_inputs, devinfo, is_scalar);
    OPT_V(brw_nir_lower_outputs, is_scalar);
+   OPT_V(brw_nir_lower_uniforms, is_scalar);
    nir_assign_var_locations(&nir->uniforms,
                             &nir->num_uniforms,
                             is_scalar ? type_size_scalar : type_size_vec4);
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list