Skip to content

Implementation of GroupSharedLimit to allow increased GroupSharedMemory#7871

Merged
JoeCitizen merged 14 commits intomicrosoft:mainfrom
JoeCitizen:Variable-Shared-Memory
Jan 20, 2026
Merged

Implementation of GroupSharedLimit to allow increased GroupSharedMemory#7871
JoeCitizen merged 14 commits intomicrosoft:mainfrom
JoeCitizen:Variable-Shared-Memory

Conversation

@JoeCitizen
Copy link
Copy Markdown
Collaborator

Add a new HLSL attribute for Compute, Amp and Mesh shaders: GroupSharedLimit.

This is used to limit the amount of group shared memory a shader is allowed to statically declare, and validation will fail if the limit is exceeded.

There is no upper limit on this attribute, and it is expected that shader writers set the limit as the lowest common denominator for their target hardware and software use case (typically 48k or 64k for modern GPUs).

If no attribute is declared the existing 32k limit is used to be compatible with existing shaders.

Extends the PSV structures to include the selected limit so that runtime validation can reject the shader if it exceeds the device support.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 4, 2025

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

Copy link
Copy Markdown
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

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

Some superficial things that'll need to be addressed at some point, I'm afraid I can't really comment on the actual details of how this works.

I suspect that the whole thing needs to be run through clang-format as well.

Comment thread lib/DxilContainer/DxilPipelineStateValidation.cpp
Comment thread lib/DxilContainer/DxilPipelineStateValidation.cpp
Comment thread lib/DxilValidation/DxilValidation.cpp
@JoeCitizen JoeCitizen marked this pull request as ready for review December 1, 2025 19:10
@damyanp damyanp linked an issue Jan 5, 2026 that may be closed by this pull request
Comment thread lib/DXIL/DxilMetadataHelper.cpp
Comment thread lib/DxilValidation/DxilContainerValidation.cpp
Comment thread lib/DxilValidation/DxilContainerValidation.cpp Outdated
Comment thread lib/DxilValidation/DxilContainerValidation.cpp
Comment thread tools/clang/lib/CodeGen/CGHLSLMS.cpp Outdated
Comment thread tools/clang/lib/CodeGen/CGHLSLMS.cpp
Comment thread lib/DxilValidation/DxilValidation.cpp
Comment thread lib/DXIL/DxilMetadataHelper.cpp Outdated
@JoeCitizen JoeCitizen force-pushed the Variable-Shared-Memory branch from 4da0fb8 to 0407f1e Compare January 13, 2026 22:06
Comment thread tools/clang/test/DXC/dumpPSV_AS.hlsl
Comment thread lib/DXIL/DxilMetadataHelper.cpp Outdated
Co-authored-by: Tex Riddell <texr@microsoft.com>
Copy link
Copy Markdown
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

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

LGTM!

@JoeCitizen JoeCitizen merged commit 5ac9138 into microsoft:main Jan 20, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Jan 20, 2026
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.

[SM 6.10] Groupshared Memory Size preview

4 participants