Skip to content

DxilValidation: TGSM size check should be per-entry in lib target #6637

@tex3d

Description

@tex3d

Description
In DxilValidation.cpp, a check for the total size of TGSM (Thread Group Shared Memory) used counts all groupshared global variables in the module. This is not valid for a library with multiple entry points, when each of which only uses a subset of the groupshared globals. The correct per-entry groupshared usage is collected into the RDAT part, but the independent calculation in the validator is left-over from enforcing the maximum on compute targets at the module level instead.

This mainly impacts Work Graphs (node shader) for now, since that's the only runtime-supported compute entry in a DXIL library.

Steps to Reproduce
Repro here:
https://godbolt.org/z/z88esxr1s

Individually, these two entries are valid, but together in a lib, they produce a validation error due to the summed groupshared memory sizes.

Actual Behavior

error: validation errors
<source>:35: error: Total Thread Group Shared Memory storage is 65536, exceeded 32768.
Validation failed.

Environment

  • DXC version: 1.8.2403
  • Host Operating System: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashvalidationRelated to validation or signing

    Type

    No type

    Projects

    Status

    Triaged

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions