tu: Fix context faults loading unused descriptor sets
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 9 Jun 2020 12:40:58 +0000 (14:40 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Jun 2020 15:35:29 +0000 (15:35 +0000)
commit334204823eee0f5d308fedbebab75228354ec07a
tree072adcf324972454a981299bb1a829ee0800c84f
parenta751051248d445c3d726a3eab8fc999b0876364e
tu: Fix context faults loading unused descriptor sets

The app is allowed to never bind descriptor sets that are statically
unused by the pipeline, which would've caused a context fault since
CP_LOAD_STATE6 would try to load the descriptors that don't exist. Fix
this by not preloading descriptors from unused descriptor sets. We could
do more fine-grained accounting of which descriptors are used, but this
is enough to fix the problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5400>
src/freedreno/vulkan/tu_pipeline.c
src/freedreno/vulkan/tu_private.h
src/freedreno/vulkan/tu_shader.c