Skip to content

Fix type annotation serialization for resources in HL modules#8442

Open
tex3d wants to merge 2 commits into
microsoft:mainfrom
tex3d:resprop-hl-meta
Open

Fix type annotation serialization for resources in HL modules#8442
tex3d wants to merge 2 commits into
microsoft:mainfrom
tex3d:resprop-hl-meta

Conversation

@tex3d
Copy link
Copy Markdown
Contributor

@tex3d tex3d commented May 11, 2026

This broke for -fcgl when adding resource type annotations in DXIL 1.8. It broke because the dx.types.ResourceProperties type was created by the DxilModule DxilOperations class (hlsl::OP), and the code tried to get this class from the DxilModule, which was nullptr because it was serializing an HLModule, not a DxilModule.

The fix moves dx.types.ResourceProperties type creation to hlsl::resource_helper, which is where it seems to fit best. The local member and accessor in hlsl::OP is left as this will cache the type, as it did before, instead of looking it up by name frequently for each dxil op. Only the initialization of the hlsl::OP member is changed to use the resource_helper function instead.

Fixes #8440

This broke for -fcgl when adding resource type annotations in DXIL 1.8. It broke because the dx.types.ResourceProperties type was created by the DxilModule DxilOperations class (hlsl::OP), and the code tried to get this class from the DxilModule, which was nullptr because it was serializing an HLModule, not a DxilModule.

The fix moves dx.types.ResourceProperties type creation to hlsl::resource_helper, which is where it seems to fit best. The local member and accessor in hlsl::OP is left as this will cache the type, as it did before, instead of looking it up by name frequently when for each dxil op. Only the initialization of the hlsl::OP member is changed to use the resource_helper function instead.

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

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

DXC crashes with -fcgl when shader contains function with resource argument

2 participants