Skip to content

Conversation

@JoeCitizen
Copy link
Collaborator

  • Adds support for the GroupSharedLimit feature for Mesh, Amplification and Node shaders.
  • Tests for each of those shader types

Copy link
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.

With minor suggested changes from earlier resolved comment, tests could easily check some more interesting edge cases that I've pointed out. As it stands, I'm not sure the update truly addressed the resolved comment from earlier.

Copy link
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.

Diagnostics need overhaul, but I've provided a suggested implementation.

@github-project-automation github-project-automation bot moved this from New to In progress in HLSL Roadmap Feb 11, 2026
Copy link
Collaborator

@V-FEXrt V-FEXrt left a comment

Choose a reason for hiding this comment

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

Generally LGTM but the more I sat with it, the more I think we need to do something about the -1 magic. Happy to leave it up to you on exactly what to do but it should be named in some manner

Node.LaunchType = DXIL::NodeLaunchType::Invalid;
Node.LocalRootArgumentsTableIndex = -1;
groupSharedLimitBytes = 0;
groupSharedLimitBytes = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I won't block on this, but I feel that using magic numbers to encode information is generally a bad idea.

If you want to encode so notion of "not-set" using something like std::optional is more appropriate

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I've now deduced that -1 -> Use max size? That seems a bit counterintuitive to me but probably a named constant is enough to clear that up

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I generally I agree, I was following the convention that appears to be set in the line above where LocalRootArgumentsTableIndex is initialised to -1

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally, we either need a special value for "unset" or an additional flag somewhere. We can add a define for this to make the code semantically better, or we can add another field/flag. Adding a flag won't change or require more metadata because this should be preserved by whether the extended metadata tag is present at all, not by any special value. We could even add accessors (get/set/isSet/unset) to keep the flag in sync. Though just adding a special defined value for "unset" seems like the simplest solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

@V-FEXrt: -1 doesn't mean "max size", it means the default isn't overridden for the shader entry. The max size used when not overridden by the shader is a long-standing default value from defines (32k for compute-like shaders except mesh shader which is 28k). The shader can set a larger size than that default, and if it uses more than the default, the runtime will check device capability to make sure the shader can run.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, given this definition, I think std::optional would work fine instead of an explicit flag and extra accessors defined in this class.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense, to be clear, I'm not specifically set on std:optional, I would be happy with a simple #define, we just have a lot of -1s floating around in the PR. even something like GS_USE_DEFAULT_SIZE would make the later code a lot easier to read


const hlsl::ShaderModel *SM = GetShaderModel();
if (SM->IsSMAtLeast(6, 10)) {
if (SM->IsSMAtLeast(6, 10) && props.groupSharedLimitBytes != -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

More important than using std::optional, this should be named in some manner[1]. What does it mean that grouSharedLimitBytes is -1?

[1]: my personal preference would be a tiny helper function but I'm flexible. Another option is defining as constant for -1 with a name that gives enough context to the meaning

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

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

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

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

4 participants