ac/llvm: replace structured by vindex != NULL in ac_build_tbuffer_store
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)
commit1038382baf9c344317cf17a17da7265fd10845e2
tree78f047b9e69333eba736f428fe7804f0634fccd8
parentc8e2c6faf6448697d949b962179a543ac9c2afee
ac/llvm: replace structured by vindex != NULL in ac_build_tbuffer_store

"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