radeonsi: fix culldist_writemask in nir path
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 31 Oct 2017 03:19:18 +0000 (14:19 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 31 Oct 2017 22:41:11 +0000 (09:41 +1100)
The shared si_create_shader_selector() code already offsets the mask.

Fixes the following piglit tests:

arb_cull_distance/clip-cull-3.shader_test
arb_cull_distance/clip-cull-4.shader_test

Fixes: 29d7bdd179bb (radeonsi: scan NIR shaders to obtain required info)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index e186661caf3b0054ba5e4941e26ed3e698fa4090..7a882273812d5478b4da55893d593054f2aad0f0 100644 (file)
@@ -302,8 +302,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
        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;