ac/llvm: replace structured by vindex != NULL in ac_build_buffer_store_common
authorMarek Olšák <marek.olsak@amd.com>
Fri, 18 Feb 2022 02:25:21 +0000 (21:25 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Feb 2022 11:41:04 +0000 (11:41 +0000)
commitc740fd18ba4c7f69aed6f8ec46422fc30137039d
tree08c193064e2fa3d6225db433436c614308544047
parent1038382baf9c344317cf17a17da7265fd10845e2
ac/llvm: replace structured by vindex != NULL in ac_build_buffer_store_common

"raw" (IDXEN=0) and "structured" (IDXEN=1) do bounds checking differently.
From `si_make_buffer_descriptor`:
    * - For VMEM and inst.IDXEN == 0 or STRIDE == 0, it's in byte units.
    * - For VMEM and inst.IDXEN == 1 and STRIDE != 0, it's in units of STRIDE.

so there is a difference between setting vindex = i32_0 and vindex = NULL.
Instead of having the `structured` flag, we can just check if vindex is NULL.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
src/amd/llvm/ac_llvm_build.c