Skip to content

[DX12] Add support for Samplers in DX12.#1331

Open
manon-traverse wants to merge 3 commits into
llvm:mainfrom
Traverse-Research:dx12-sampler-support
Open

[DX12] Add support for Samplers in DX12.#1331
manon-traverse wants to merge 3 commits into
llvm:mainfrom
Traverse-Research:dx12-sampler-support

Conversation

@manon-traverse

@manon-traverse manon-traverse commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Adds support for samplers in DX12.
This change is a lot larger than you would expect from adding samplers.
This is because samplers need to live in a separate DescriptorHeap which cascaded into a couple of issues:

  • Building the descriptor tables requires building tables for both sampler and CBV/SRV/UAV descriptors.
  • The binding of descriptor tables can no longer be implied based on the DescriptorSets defined in .test file
  • A layout must be generated when the root signature is generated based on the bindings
  • In case of root signatures defined in the shader, the layout must be extracted from that root signature by deserializing it.

Adding this feature does allow more tests to succeed on DX12.

Comment thread lib/API/DX/Device.cpp Outdated
Comment thread lib/API/DX/Device.cpp
Comment on lines +324 to +341
enum class RootParameterType : uint32_t {
DescriptorTable = 0,
SamplerTable,
Constant,
CBV,
SRV,
UAV,
};

struct RoogtSignatureLayout {
RootParameterType ParameterType : 3;
uint32_t Count : 29;

RoogtSignatureLayout(RootParameterType ParameterType, uint32_t Count)
: ParameterType(ParameterType), Count(Count) {}
RoogtSignatureLayout() = delete;
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could've probably been two PRs, but at least this way it doesn't only introduces new API but it also shows how it's used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants