We are about to start doing load_var of a sampler to get the binding table
index.  If we're going to do this, then we need to have the load_var
instructions when we run lower_samplers.  If we let lower_io run on
uniforms first, then they will get replaced with bogus load_uniform
intrinsics which we don't want.
---
 src/mesa/drivers/dri/i965/brw_nir.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_nir.c 
b/src/mesa/drivers/dri/i965/brw_nir.c
index 287f935..9817391 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -605,14 +605,14 @@ brw_create_nir(struct brw_context *brw,
 
    nir = brw_preprocess_nir(nir, is_scalar);
 
-   OPT(nir_lower_system_values);
-   OPT_V(brw_nir_lower_uniforms, is_scalar);
-
    if (shader_prog) {
       OPT_V(nir_lower_samplers, shader_prog);
       OPT_V(nir_lower_atomics, shader_prog);
    }
 
+   OPT(nir_lower_system_values);
+   OPT_V(brw_nir_lower_uniforms, is_scalar);
+
    if (nir->stage != MESA_SHADER_TESS_CTRL &&
        nir->stage != MESA_SHADER_TESS_EVAL) {
       nir = brw_nir_lower_io(nir, devinfo, is_scalar);
-- 
2.5.0.400.gff86faf

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to