broadcom/compiler: handle vec2 load/store index
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 26 Oct 2022 07:01:59 +0000 (09:01 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Fri, 28 Oct 2022 06:23:32 +0000 (08:23 +0200)
commit8cd50ef0713b054da3b5615c81939d4c649a44ac
tree7f0fe3ea35814dee0b58e8e9ad0c56f535847bae
parent2ab70c1004870e2bb1cbd7ec50f461974e3ffa85
broadcom/compiler: handle vec2 load/store index

In vulkan, we load descriptors via vulkan resource index, which
returns a vec2, of which we want component 0 which holds the actual
index. Typically, this will be cleaned-up by the time we get to
emitting VIR so the index is a single scalar component, but there
are some cases where this might no be the case, so make sure we don't
assume it to be a scalar, like we do in other places.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19313>
src/broadcom/compiler/nir_to_vir.c