From 662c4c99065381b8e265310d176cfdef6698ca57 Mon Sep 17 00:00:00 2001 From: Eduardo Lima Mitev Date: Tue, 16 Jun 2015 21:31:49 +0200 Subject: i965/nir/vec4: Implement store_output intrinsic This implementation is based on the current URB setup in vec4_visitor, which requires the output register to be stored in the output_reg array at variable's original shader location index. But since nir_lower_io() pass uses the value in var->data.driver_location, we need to put there var->data.location instead, prior to calling nir_lower_io(), so that we end up with the correct index in const_index[0]. The driver_location is not used at all, so this patch also disables the nir_assign_var_locations pass on non-scalar shaders. Reviewed-by: Jason Ekstrand --- src/mesa/drivers/dri/i965/brw_nir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/i965/brw_nir.c') diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index b241121dac7..4f7335024a4 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.c +++ b/src/mesa/drivers/dri/i965/brw_nir.c @@ -106,13 +106,16 @@ brw_create_nir(struct brw_context *brw, &nir->num_direct_uniforms, &nir->num_uniforms, is_scalar); + nir_assign_var_locations(&nir->outputs, &nir->num_outputs, is_scalar); } else { nir_assign_var_locations(&nir->uniforms, &nir->num_uniforms, is_scalar); + + foreach_list_typed(nir_variable, var, node, &nir->outputs) + var->data.driver_location = var->data.location; } nir_assign_var_locations(&nir->inputs, &nir->num_inputs, is_scalar); - nir_assign_var_locations(&nir->outputs, &nir->num_outputs, is_scalar); nir_lower_io(nir, is_scalar); -- cgit v1.2.3