Description
We forgot to update RDAT part type versioning for 1.9 release.
Details
The following code determines the valid RDAT part types based on the DXIL version.
|
: DXIL::CompareVersions(Major, Minor, 1, 8) == 0 |
|
? RuntimeDataPartType::Last_1_8 |
Last_1_8 is the high-water mark for released parts. Released parts are frozen and can only be updated in version-compatible ways. This code will return LastExperimental instead for 1.9, even though 1.9 is considered a release shader model, and should not include all experimental tables as part of what's considered official 1.9. Those experimental tables are all subject to change.
Impact
What does this mean?
The current 1.9 release of the Compiler and Validator (for SM 6.9) will allow, even expect, these tables in DXIL 1.9 (SM 6.9) libraries (when something might use them). In practice, they should go unused most of the time, thus having no real impact. However, we don't prevent ordinary shader entry points from being used in DXIL libraries, and if you use those, it triggers the use of some of these experimental tables. A compiled DXIL library from this release of the compiler could be used with a future version of the D3D runtime that consumes tables with the same IDs as these experimental tables, but with different table definitions, potentially leading to crashes or undefined behavior in the runtime.
Recommendation
I think we should update the code to fix the issue, pull this fix into the 1.9 branch, and add this to a next point release of the compiler. The following 1-line change should fix the issue:
- : DXIL::CompareVersions(Major, Minor, 1, 8) == 0
+ : DXIL::CompareVersions(Major, Minor, 1, 9) <= 0
We should also add a test, and potentially add a way to differentiate the highest released DXIL version from the highest DXIL version, like we now do for Shader Model. This code could be changed to reference the highest released version in the last condition, instead of a hard coded number.
Environment
- DXC version: v1.9.2602
- Host Operating System: any
Description
We forgot to update RDAT part type versioning for 1.9 release.
Details
The following code determines the valid RDAT part types based on the DXIL version.
DirectXShaderCompiler/include/dxc/DxilContainer/DxilRuntimeReflection.h
Lines 102 to 103 in 05de2c9
Last_1_8is the high-water mark for released parts. Released parts are frozen and can only be updated in version-compatible ways. This code will returnLastExperimentalinstead for 1.9, even though 1.9 is considered a release shader model, and should not include all experimental tables as part of what's considered official 1.9. Those experimental tables are all subject to change.Impact
What does this mean?
The current 1.9 release of the Compiler and Validator (for SM 6.9) will allow, even expect, these tables in DXIL 1.9 (SM 6.9) libraries (when something might use them). In practice, they should go unused most of the time, thus having no real impact. However, we don't prevent ordinary shader entry points from being used in DXIL libraries, and if you use those, it triggers the use of some of these experimental tables. A compiled DXIL library from this release of the compiler could be used with a future version of the D3D runtime that consumes tables with the same IDs as these experimental tables, but with different table definitions, potentially leading to crashes or undefined behavior in the runtime.
Recommendation
I think we should update the code to fix the issue, pull this fix into the 1.9 branch, and add this to a next point release of the compiler. The following 1-line change should fix the issue:
We should also add a test, and potentially add a way to differentiate the highest released DXIL version from the highest DXIL version, like we now do for Shader Model. This code could be changed to reference the highest released version in the last condition, instead of a hard coded number.
Environment