Skip to content

[0049] Groupshared limit vs usage #761

@tex3d

Description

@tex3d

Which proposal does this relate to?
https://github.com/microsoft/hlsl-specs/blob/main/proposals/0049-variable-groupshared-memory.md

Describe the issue or outstanding question.
When reviewing the implementation PR microsoft/DirectXShaderCompiler#7871, I realized there may be a bit of an issue with the design.

Libraries already went in the direction of reporting groupshared memory usage by entry point in the RDAT shader info structure (with GroupSharedBytesUsed). This seems like a better way to report groupshared usage for a compiled shader than the limit value specified in the attribute. The attribute is still useful for limiting the groupshared memory to the specified maximum to remain within a capability target, but after a shader is compiled, the computed maximum groupshared memory used by a shader seems like the value that should be placed in PSV0 or RDAT for runtime checks against the device capability.

As the design already fails to address the RDAT/library side (required for node shaders), and RDAT already contains this usage value, it would make more sense to add the corresponding usage value to PSV0 instead of the maximum. The maximum would remain in DXIL metadata (and DxilFunctionProps) though, since that's still needed for checking that the calculated usage doesn't exceed this expected maximum.

Additional context
See comment on PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions