Skip to content

Allow mixed descriptor sets containing samplers and resources.#170

Merged
crud89 merged 8 commits intomainfrom
mix-samplers-and-resources
Oct 5, 2025
Merged

Allow mixed descriptor sets containing samplers and resources.#170
crud89 merged 8 commits intomainfrom
mix-samplers-and-resources

Conversation

@crud89
Copy link
Copy Markdown
Owner

@crud89 crud89 commented Oct 5, 2025

Describe the pull request

This PR overhauls the binding of descriptor sets containing both, samplers and resources. This was partially supported previously, but only for the DirectX 12 backend, where it too only worked under certain circumstances, due to root parameter indices not being properly mapped across multiple descriptor tables for a single descriptor set. #163 thus temporarily removed support entirely by throwing an exception during pipeline creation, if such a scenario was encountered. This PR now addresses those issues and implements proper support for such a use case.

For the Vulkan backend, this resulted in a refactoring of the descriptor buffer implementation, as descriptor sets must be fully bound to a descriptor buffer. This is different to D3D12, where a descriptor set can (and must) be split over two descriptor heaps (for samplers and resources), which is not possible in Vulkan. Fortunately, GPUinfo reports equal memory requirements for samplerDescriptorBufferAddressSpaceSize/resourceDescriptorBufferAddressSpaceSize and descriptorBufferAddressSpaceSize over all devices that support VK_EXT_descriptor_buffer, so we can easily combine sampler and resource heaps into a single heap that binds all resource types.

Related issues

@crud89 crud89 added this to the Alpha #05 milestone Oct 5, 2025
@crud89 crud89 self-assigned this Oct 5, 2025
@crud89 crud89 added Vulkan πŸŒ‹ The issue involves the Vulkan backend. DX12 ❎ The issue involves the DX12 backend. labels Oct 5, 2025
@crud89 crud89 added this to LiteFX Oct 5, 2025
@crud89 crud89 moved this to In Progress in LiteFX Oct 5, 2025
@crud89
Copy link
Copy Markdown
Owner Author

crud89 commented Oct 5, 2025

Run: checks

@crud89 crud89 merged commit 612e232 into main Oct 5, 2025
9 checks passed
@crud89 crud89 deleted the mix-samplers-and-resources branch October 5, 2025 13:23
@crud89 crud89 moved this from In Progress to v0.5.1 in LiteFX Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX12 ❎ The issue involves the DX12 backend. Vulkan πŸŒ‹ The issue involves the Vulkan backend.

Projects

Status: v0.5.1

Development

Successfully merging this pull request may close these issues.

1 participant