[Mesa-dev] [PATCH] radeonsi: fix culldist_writemask in nir path

Timothy Arceri tarceri at itsqueeze.com
Tue Oct 31 03:26:00 UTC 2017


In RADV we need to offset the writemask because
nir_lower_clip_cull_distance_arrays() combines the arrays. However
we can't use this with radeonsi currently so don't offset the
writemask.

Fixes the following piglit tests:

arb_cull_distance/clip-cull-3.shader_test
arb_cull_distance/clip-cull-4.shader_test
---
 src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index e186661caf..7a88227381 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -295,22 +295,21 @@ void si_nir_scan_shader(const struct nir_shader *nir,
 			info->samplers_declared |=
 				u_bit_consecutive(variable->data.binding, aoa_size);
 		else if (base_type == GLSL_TYPE_IMAGE)
 			info->images_declared |=
 				u_bit_consecutive(variable->data.binding, aoa_size);
 	}
 
 	info->num_written_clipdistance = nir->info.clip_distance_array_size;
 	info->num_written_culldistance = nir->info.cull_distance_array_size;
 	info->clipdist_writemask = u_bit_consecutive(0, info->num_written_clipdistance);
-	info->culldist_writemask = u_bit_consecutive(info->num_written_clipdistance,
-						     info->num_written_culldistance);
+	info->culldist_writemask = u_bit_consecutive(0, info->num_written_culldistance);
 
 	if (info->processor == PIPE_SHADER_FRAGMENT)
 		info->uses_kill = nir->info.fs.uses_discard;
 
 	/* TODO make this more accurate */
 	info->const_buffers_declared = u_bit_consecutive(0, SI_NUM_CONST_BUFFERS);
 	info->shader_buffers_declared = u_bit_consecutive(0, SI_NUM_SHADER_BUFFERS);
 
 	func = (struct nir_function *)exec_list_get_head_const(&nir->functions);
 	nir_foreach_block(block, func->impl) {
-- 
2.14.3



More information about the mesa-dev mailing list