zink: implement indirect buffer indexing
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 12 Apr 2022 21:26:53 +0000 (17:26 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 10 May 2022 05:55:55 +0000 (05:55 +0000)
commita7327c7cac9b49ac1c7679f91c4727da0d60f501
tree403fb638b192dc80c3db6d1bdcbdcab28f8e5fde
parent1f8cd768d6b981685ce6e4aa2f4d1a55e43d78d6
zink: implement indirect buffer indexing

this compacts all buffers in the shader into an array that can be
used in a single descriptor, thus handling the case of indirect indexing
while also turning constant indexing into indirect (with const offsets)
since there's no sane way to distinguish

a "proper" implementation of this would be to skip gl_nir_lower_buffers
and nir_lower_explicit_io altogether and retain the derefs, but that would
require a ton of legwork of other nir passes which only operate on the
explicit io intrinsics

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15906>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_compiler.c
src/gallium/drivers/zink/zink_descriptors_lazy.c