microsoft/compiler: For Vulkan environment, don't create resource handles upfront
authorJesse Natalie <jenatali@microsoft.com>
Tue, 13 Apr 2021 20:05:13 +0000 (13:05 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Apr 2021 02:43:30 +0000 (02:43 +0000)
commit53c97f92cd6c44cea59c38e4faa02c5d4f43438f
treeed1d8902289606fcd02694dd08a9e7d06abbefcb
parentf6667b13f249188e0d2759e13eca95a9ea8543ee
microsoft/compiler: For Vulkan environment, don't create resource handles upfront

Creating resource handles upfront works well while we have fixed-size resource
counts, but once we start talking about bindless, having arrays or even sets
of handles becomes prohibitive. It also precludes dynamic indexing for textures.

Instead, rely on the load_vulkan_descriptor instruction for UBO/SSBO, and undo
nir_lower_samplers so we continue to have deref chains for image/sampler accesses.
Then, emit handles at the end of a deref chain - the chain should only have
array offsets, so once we get to a type that's not an array anymore, we can
emit the handle.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10288>
src/microsoft/compiler/nir_to_dxil.c
src/microsoft/spirv_to_dxil/spirv_to_dxil.c