[Mesa-dev] [PATCH] radeonsi: fix culldist_writemask in nir path
Marek Olšák
maraeo at gmail.com
Tue Oct 31 18:08:53 UTC 2017
Yes, si_create_shader_selector contains this:
sel->culldist_mask = sel->info.culldist_writemask <<
sel->info.num_written_clipdistance;
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Tue, Oct 31, 2017 at 4:26 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list