Skip to content

Conversation

joaosaffran
Copy link
Collaborator

This patch is updating the spec to match DXC behaviour for Descriptor Ranges flags serialization on root signatures version 1.

DXC: https://github.com/microsoft/DirectXShaderCompiler/blob/d43d909801c185e5bad11a683a970cd23957c3c9/lib/DxilRootSignature/DxilRootSignature.cpp#L118

@joaosaffran joaosaffran requested a review from inbelic June 24, 2025 21:53
Copy link
Collaborator

@inbelic inbelic left a comment

Choose a reason for hiding this comment

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

Can we update the pr title/description to match the format of other prs and update the title so that it also denotes changes to the valid flags + root descriptor flags

@joaosaffran joaosaffran changed the title [ROOT-SIGNATURE] Fix default values for Descriptor Range Flags in Version 1 [Root Signatures] Fix default values for Descriptor Range Flags and Root Descriptor Flags in Version 1 Jun 24, 2025
@@ -461,7 +461,10 @@ As specified in the grammar, '0' denotes there are no flags set.
- `RootFlags = 0`
- `ROOT_DESCRIPTOR_FLAGS` and `DESCRIPTOR_RANGE_FLAGS`
- Version 1.0:
- `DATA_VOLATILE`
- `CBV`: `DATA_VOLATILE | DESCRIPTORS_VOLATILE`
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should also be split into the different flag types. DESCRIPTORS_VOLATILE isn't a valid ROOT_DESCRIPTOR_FLAG

Copy link
Collaborator

Choose a reason for hiding this comment

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

@joaosaffran This does not appear to have been handled before merging.

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 will address it in a future PR

inbelic added a commit to llvm/llvm-project that referenced this pull request Jul 4, 2025
…gnature Version (#145828)

This pr updates `setDefaultFlags` in `HLSLRootSignature.h` to account
for which version it should initialize the default flag values for.

- Updates `setDefaultFlags` with a `Version` argument and initializes
them to be compliant as described
[here](llvm/wg-hlsl#297).
- Updates `RootSignatureParser` to retain the `Version` and pass this
into `setDefaultFlags`
- Updates all uses of `setDefaultFlags` in test-cases
- Adds some new unit testing to ensure behaviour is as expected and that
the Parser correctly passes down the version

Resolves #145820.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 4, 2025
…for Root Signature Version (#145828)

This pr updates `setDefaultFlags` in `HLSLRootSignature.h` to account
for which version it should initialize the default flag values for.

- Updates `setDefaultFlags` with a `Version` argument and initializes
them to be compliant as described
[here](llvm/wg-hlsl#297).
- Updates `RootSignatureParser` to retain the `Version` and pass this
into `setDefaultFlags`
- Updates all uses of `setDefaultFlags` in test-cases
- Adds some new unit testing to ensure behaviour is as expected and that
the Parser correctly passes down the version

Resolves llvm/llvm-project#145820.
inbelic added a commit to llvm/llvm-project that referenced this pull request Jul 9, 2025
…nature` (#147111)

This pr resolves some discrepancies in verification during `validate` in
`DXILRootSignature.cpp`.

Note: we don't add a backend test for version 1.0 flag values because it
treats the struct as though there is no flags value. However, this will
be used when we use the verifications in the frontend.

- Updates `verifyDescriptorFlag` to check for valid flags based on
version, as reflected [here](llvm/wg-hlsl#297)
- Add test to demonstrate updated flag verifications
- Adds `verifyNumDescriptors` to the validation of `DescriptorRange`s
- Add a test to demonstrate `numDescriptors` verification
- Updates a number of tests that mistakenly had an invalid
`numDescriptors` specified

Resolves: #147107
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 9, 2025
…DXILRootSignature` (#147111)

This pr resolves some discrepancies in verification during `validate` in
`DXILRootSignature.cpp`.

Note: we don't add a backend test for version 1.0 flag values because it
treats the struct as though there is no flags value. However, this will
be used when we use the verifications in the frontend.

- Updates `verifyDescriptorFlag` to check for valid flags based on
version, as reflected [here](llvm/wg-hlsl#297)
- Add test to demonstrate updated flag verifications
- Adds `verifyNumDescriptors` to the validation of `DescriptorRange`s
- Add a test to demonstrate `numDescriptors` verification
- Updates a number of tests that mistakenly had an invalid
`numDescriptors` specified

Resolves: llvm/llvm-project#147107
@joaosaffran joaosaffran merged commit cc4a185 into llvm:main Aug 11, 2025
@joaosaffran
Copy link
Collaborator Author

joaosaffran commented Aug 11, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants