Skip to content

[SPIR-V] Add sampler & resource heaps for textures#8281

Merged
Keenuts merged 7 commits intomicrosoft:mainfrom
Keenuts:descriptor-heap
Mar 30, 2026
Merged

[SPIR-V] Add sampler & resource heaps for textures#8281
Keenuts merged 7 commits intomicrosoft:mainfrom
Keenuts:descriptor-heap

Conversation

@Keenuts
Copy link
Copy Markdown
Collaborator

@Keenuts Keenuts commented Mar 20, 2026

Resource & Sampler heaps are already implemented in DXC, but rely on an emulated heap. A new VK/SPV extension bring actual descriptor heaps. This is the first step toward a complete support.

This commits focuses on Texture/Sampler/Buffer resources, which are all backed by OpTypeImage/OpTypeSampler. This path is a bit simpler as we have no ArrayStride, nor OpAccessChain legalization issues: the whole image handle loading is handled in DXC, and the rest follows the normal path.

Next step is to implement RWStructuredBuffer/StructuredBuffer support, with counters and chain legalization.

Related to #8243

@Keenuts
Copy link
Copy Markdown
Collaborator Author

Keenuts commented Mar 20, 2026

CI failure is because of SPV tools update, requires #8278

Resource & Sampler heaps are already implemented in DXC, but rely
on an emulated heap. A new VK/SPV extension bring actual descriptor
heaps. This is the first step toward a complete support.

This commits focuses on Texture/Sampler/Buffer resources, which are
all backed by OpTypeImage/OpTypeSampler. This path is a bit simpler as
we have no ArrayStride, nor OpAccessChain legalization issues: the whole
image handle loading is handled in DXC, and the rest follows the normal
path.

Next step is to implement RWStructuredBuffer/StructuredBuffer support,
with counters and chain legalization.

Related to microsoft#8243
@Keenuts
Copy link
Copy Markdown
Collaborator Author

Keenuts commented Mar 24, 2026

Rebased on main now that SPV-tools fixes are merged.

Copy link
Copy Markdown
Collaborator

@s-perron s-perron left a comment

Choose a reason for hiding this comment

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

Can you move the parts of the code that are not used (and therefore not tested) in this PR to the one where it is used?

I have a couple other ideas, but in general this is in good shape.

Comment thread include/dxc/Support/HLSLOptions.td
Comment thread tools/clang/include/clang/SPIRV/SpirvBuilder.h Outdated
Comment thread tools/clang/include/clang/SPIRV/SpirvInstruction.h Outdated
Comment thread tools/clang/include/clang/SPIRV/SpirvInstruction.h
Comment thread tools/clang/lib/SPIRV/DeclResultIdMapper.cpp Outdated
Comment thread tools/clang/lib/SPIRV/DeclResultIdMapper.cpp Outdated
Comment thread tools/clang/lib/SPIRV/SpirvEmitter.cpp Outdated
Comment thread tools/clang/lib/SPIRV/SpirvType.cpp Outdated
@Keenuts Keenuts requested a review from s-perron March 24, 2026 16:45
Comment thread tools/clang/lib/SPIRV/DeclResultIdMapper.cpp Outdated
Comment thread include/dxc/Support/HLSLOptions.td
Comment thread tools/clang/test/CodeGenSPIRV/resource-heap-ext-texture.hlsl Outdated
Comment thread tools/clang/lib/SPIRV/SpirvType.cpp Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 25, 2026

✅ With the latest revision this PR passed the C/C++ code formatter.

@Keenuts Keenuts merged commit 2762c56 into microsoft:main Mar 30, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Mar 30, 2026
@Keenuts Keenuts deleted the descriptor-heap branch March 30, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants