llvmpipe,lavapipe: Descriptors
Make llvmpipe jit resources explicit in lavapipe. This allows creating buffers for descriptor sets and binding them to UBO slots. The resource lowering and llvmpipe backend compiler is updated to lead jit resources from those UBOs. Texture sampling and image operations are implemented by pre compiling sample and image functions based on the used textures, samplers, sample keys and image operations. The shader then calls those functions by loading a function pointer from the descriptor.
Moving descriptor handling from GL-style binding slots to a proper implementation of the vulkan model allows us to raise the descriptor limits and implement:
VK_EXT_descriptor_buffer
EXT_descriptor_indexing
VK_EXT_mutable_descriptor_type
There are currently a few remaining issues:
- The lavapipe descriptor size is above the limit allowed for
VK_EXT_descriptor_buffer
. (lp_jit_texture
is HUGE) - There are a few descriptor indexing fails that seem to be vertex shader related.
- Gallivm doesn't handle control flow in a sane way, so texture/image operations need to be guarded by an
if (any_active) {}
. - The pre compiled sample/image functions aren't cached yet. (Also: Pre compiling lots of sampler/texture combinations hit a lot of issues inside
lp_bld_sample_soa.c
. I chose to work around them for now.)