-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-function feature flags and min target in RDAT are incorrect #6218
Comments
tex3d
added a commit
that referenced
this issue
Feb 10, 2024
…ging (#6207) Add ShaderKind::Last_1_8 for shader mask Add shader model comments before flag groupings in DxilConstants.h and DxilShaderFlags. Add missing flag checks for min shader model in RDAT function info. Move ShaderCompatInfo computation into DxilModule, propagate callee info. Move computation of shader model requirements based on flags into DxilModule. Finalize requirements for entry functions in AdjustMinimumShaderModelAndFlags. Fixes for function level flag tracking: - DerivativesInMeshAndAmpShaders: use flag to track deriv use, then adjust for entry functions. - hasUAVs: based on resource use in function instead of global resources. - WriteableMSAATextures: based on use in function instead of global resources. - Also catch cases for dynamic res from any use by looking at create/annotate handle, not just the TextureStoreSample op. - RaytracingTier1_1: move module-level detection to CollectShaderFlagsForModule - Marked deriv and quad ops as being supported in node. - Fixed SampleCmpBias to be considered gradient op. - Update RDAT definitions to dump more useful info for testing Fixes #6218.
tex3d
added a commit
to tex3d/DirectXShaderCompiler
that referenced
this issue
Feb 10, 2024
…ging (microsoft#6207) Add ShaderKind::Last_1_8 for shader mask Add shader model comments before flag groupings in DxilConstants.h and DxilShaderFlags. Add missing flag checks for min shader model in RDAT function info. Move ShaderCompatInfo computation into DxilModule, propagate callee info. Move computation of shader model requirements based on flags into DxilModule. Finalize requirements for entry functions in AdjustMinimumShaderModelAndFlags. Fixes for function level flag tracking: - DerivativesInMeshAndAmpShaders: use flag to track deriv use, then adjust for entry functions. - hasUAVs: based on resource use in function instead of global resources. - WriteableMSAATextures: based on use in function instead of global resources. - Also catch cases for dynamic res from any use by looking at create/annotate handle, not just the TextureStoreSample op. - RaytracingTier1_1: move module-level detection to CollectShaderFlagsForModule - Marked deriv and quad ops as being supported in node. - Fixed SampleCmpBias to be considered gradient op. - Update RDAT definitions to dump more useful info for testing Fixes microsoft#6218. (cherry picked from commit 9c518db)
tex3d
added a commit
that referenced
this issue
Feb 10, 2024
…ging (#6207) (#6273) Add ShaderKind::Last_1_8 for shader mask Add shader model comments before flag groupings in DxilConstants.h and DxilShaderFlags. Add missing flag checks for min shader model in RDAT function info. Move ShaderCompatInfo computation into DxilModule, propagate callee info. Move computation of shader model requirements based on flags into DxilModule. Finalize requirements for entry functions in AdjustMinimumShaderModelAndFlags. Fixes for function level flag tracking: - DerivativesInMeshAndAmpShaders: use flag to track deriv use, then adjust for entry functions. - hasUAVs: based on resource use in function instead of global resources. - WriteableMSAATextures: based on use in function instead of global resources. - Also catch cases for dynamic res from any use by looking at create/annotate handle, not just the TextureStoreSample op. - RaytracingTier1_1: move module-level detection to CollectShaderFlagsForModule - Marked deriv and quad ops as being supported in node. - Fixed SampleCmpBias to be considered gradient op. - Update RDAT definitions to dump more useful info for testing Fixes #6218. (cherry picked from commit 9c518db)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
RDAT has per-function feature requirement flags, compatible shader stage flags, and a minimum shader target that should take into account internal function calls and should adjust the minimum shader targets and legal shader stages based on optional feature usage.
Several issues were preventing these from correctly representing the requirements for the function:
DerivativesInMeshAndAmplificationShaders
)This also impacts module-level flags, since they are just the union of flags computed for each function, plus a few module-scope checks.
Fixing these issues can cause differences in the
DFCC_RuntimeData
(RDAT
) part as well as DxilModule ShaderFlags (in metadata) and the DFCC_FeatureInfo (SFI0
) parts. This would be considered a validator-breaking change, since the validator uses the same code to compute these details, then makes sure the container matches these expectations.Steps to Reproduce
The following reflection test demonstrates some of these bugs based on the difference between expected result from 1.7 and fixed 1.8 validator:
Expected Behavior
Optional feature use and potential optional feature use is always captured into flags. Min shader model is correct when combining all called functions and any special-case logic required for a final entry point function of a particular kind.
For the example above, when expected is different than actual, expected values are shown in the RDAT18 checks.
Actual Behavior
See above description of cases not captured correctly, as well as the RDAT17 sections of the example test case above.
Environment
main
branch (dcb618a2f1b7f4265fc2b77c12291f76eb334ae3
).The text was updated successfully, but these errors were encountered: