Skip to content

Provide binding hints to shader reflection to have better control over the pipeline layout.#168

Merged
crud89 merged 9 commits intomainfrom
pipeline-binding-hints
Sep 26, 2025
Merged

Provide binding hints to shader reflection to have better control over the pipeline layout.#168
crud89 merged 9 commits intomainfrom
pipeline-binding-hints

Conversation

@crud89
Copy link
Copy Markdown
Owner

@crud89 crud89 commented Sep 25, 2025

Describe the pull request

This PR introduces a new PipelineBindingHint structure that can be passed to shader reflection in order to control aspects of the resulting pipeline layout that can not be implicitly inferred from the shader metadata. Currently this includes:

  • Turning a descriptor set into a push constant range. This is especially helpful for the D3D12 backend, as it removes the need to define explicit root signatures in the shaders.
  • Providing a static/immutable sampler state to sampler bindings. This works for both backends. In D3D12 this removes the need to define a root signature in the shader. In Vulkan, this was previously impossible without explicitly defining the pipeline layout.
  • Providing a upper limit for the descriptor count of unbounded arrays. This is especially helpful for the Vulkan backend, where one would frequently run into different validation errors, as the descriptor count of an unbounded array still counts towards the device limits, even if the actual allocated memory is managed independently from this after Use descriptor buffers to implement descriptor management for Vulkan.Β #163. Setting the descriptor count to a low number instead does not work either, as the driver reserves address space based on the descriptor count. With this addition, clients gain better control over the individual array definitions without having to explicitly define the whole pipeline layout.

Additionally, hints serve as a rudimentary validation logic. They are used to communicate "intend", so if the layout deviates from this expressed intend, diagnostic log messages (mostly warnings) will be issued.

Related issues

@crud89 crud89 added this to the Alpha #05 milestone Sep 25, 2025
@crud89 crud89 self-assigned this Sep 25, 2025
@crud89 crud89 added this to LiteFX Sep 25, 2025
@crud89 crud89 added Vulkan πŸŒ‹ The issue involves the Vulkan backend. DX12 ❎ The issue involves the DX12 backend. labels Sep 25, 2025
@crud89 crud89 moved this to In Progress in LiteFX Sep 25, 2025
@crud89 crud89 force-pushed the pipeline-binding-hints branch from 42e1fea to db10365 Compare September 26, 2025 07:23
@crud89
Copy link
Copy Markdown
Owner Author

crud89 commented Sep 26, 2025

Run: tests

@crud89
Copy link
Copy Markdown
Owner Author

crud89 commented Sep 26, 2025

Run: builds,tidy

@crud89 crud89 merged commit 184bc14 into main Sep 26, 2025
9 checks passed
@crud89 crud89 deleted the pipeline-binding-hints branch September 26, 2025 08:30
@crud89 crud89 moved this from In Progress to v0.5.1 in LiteFX Sep 26, 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.

Add binding hints to shader reflection for unsupported scenarios.

1 participant