broadcom/compiler: add driver_location_map at vs prog data
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 30 Jul 2020 23:09:03 +0000 (01:09 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Mar 2021 17:10:47 +0000 (17:10 +0000)
commitb71fd5587e0611057bccc170bcaf356fc3afb4a8
tree5c82117b5d0a7afd0f4df9a0f87e333a0222d3e4
parent2be0c367750dc8ce8140d4f71081c9add7dbfd07
broadcom/compiler: add driver_location_map at vs prog data

This maps the nir shader data.location to its final
data.driver_location. In general we are using the driver location as
index (like vattr_sizes on the same struct), so having this map is
useful if what we have is the data.location, and we don't have
available the original nir shader.

v2: use memset instead of for loop, and nir_foreach_shader_in_variable
    instead of nir_foreach_variable_with_modes (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9403>
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c