Skip to content

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:

  1. VK_EXT_descriptor_buffer
  2. EXT_descriptor_indexing
  3. VK_EXT_mutable_descriptor_type

There are currently a few remaining issues:

  1. The lavapipe descriptor size is above the limit allowed for VK_EXT_descriptor_buffer. (lp_jit_texture is HUGE)
  2. There are a few descriptor indexing fails that seem to be vertex shader related.
  3. Gallivm doesn't handle control flow in a sane way, so texture/image operations need to be guarded by an if (any_active) {}.
  4. 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.)

Merge request reports