diff options
author | Iago Toral Quiroga <[email protected]> | 2015-07-03 08:23:33 +0200 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-08-03 09:40:47 -0700 |
commit | 6e58fc56a5a396020cd299db11895120ec3da520 (patch) | |
tree | 4a2b47c96e6a32c359c953f0b36a4121896ee181 /src/mesa | |
parent | 01f6235020f9f0c2bc1a6e6ea9bd15c22fb2bcf5 (diff) |
i965/nir: Dot not assign direct uniform locations first for vec4-based shaders
In the vec4 backend we want uniform locations to be assigned consecutively
since that way the offsets produced by nir_lower_io are exactly what we
need to implement nir_intrinsic_load_uniform. Otherwise we would need a
mapping to match the output of nir_lower_io to the actual uniform registers
we need to use.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index 8700cb71ad4..d81d82323bb 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.c +++ b/src/mesa/drivers/dri/i965/brw_nir.c @@ -101,10 +101,16 @@ brw_create_nir(struct brw_context *brw, /* Get rid of split copies */ nir_optimize(nir); - nir_assign_var_locations_direct_first(nir, &nir->uniforms, - &nir->num_direct_uniforms, - &nir->num_uniforms, - is_scalar); + if (is_scalar) { + nir_assign_var_locations_direct_first(nir, &nir->uniforms, + &nir->num_direct_uniforms, + &nir->num_uniforms, + is_scalar); + } else { + nir_assign_var_locations(&nir->uniforms, + &nir->num_uniforms, + is_scalar); + } nir_assign_var_locations(&nir->inputs, &nir->num_inputs, is_scalar); nir_assign_var_locations(&nir->outputs, &nir->num_outputs, is_scalar); |