[Mesa-dev] [PATCH 1/2] ac: avoid infinite loop storing doubles to ssbo
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Wed Jan 17 11:36:57 UTC 2018
On Wed, Jan 17, 2018 at 10:47 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> Without this count will always be greater than 4 and we will always
> set the writemask so the loop can never exit.
>
> Fixes: 91074bb11bda "radv/ac: Implement Float64 SSBO stores."
> ---
> src/amd/common/ac_nir_to_llvm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index ddcd546b93..c24e563695 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -2453,6 +2453,7 @@ static void visit_store_ssbo(struct ac_nir_context *ctx,
> if (count > 4) {
> writemask |= ((1u << (count - 4)) - 1u) << (start + 4);
> count = 4;
> + elem_size_mul = 1;
This seems confusing to me. We do the initial iteration writemask
check before multiplying by elem_size_mul, so writemask is in terms of
64-bit components, but after the first iteration, writemask is in
terms of 32-bit components? Looks like we should expand the bitmask
beforehand similarly as in visit_store_var, and then don't multiply by
elem_size_mul in the loop.
> }
>
> if (count == 4) {
> --
> 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