diff options
author | S. Bharadwaj Yadavalli <Bharadwaj.Yadavalli@microsoft.com> | 2024-05-06 18:33:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 18:33:57 -0400 |
commit | 080978dd2067d0c9ea7e229aa7696c2480d89ef1 (patch) | |
tree | fd0b31724495febade372d0eb56ccfa3dbf6bb4c /clang/unittests/Driver | |
parent | 89e0557e48155d7eaab2a25426f6dfc9493f2474 (diff) | |
download | llvm-080978dd2067d0c9ea7e229aa7696c2480d89ef1.zip llvm-080978dd2067d0c9ea7e229aa7696c2480d89ef1.tar.gz llvm-080978dd2067d0c9ea7e229aa7696c2480d89ef1.tar.bz2 |
[DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (#90809)
An earlier commit provided a way to decouple DXIL version from Shader
Model version by representing the DXIL version as `SubArch` in the DXIL
Target Triple and adding corresponding valid DXIL Arch types.
This change constructs DXIL target triple with DXIL version that is
deduced from Shader Model version specified in the following scenarios:
1. When compilation target profile is specified:
For e.g., DXIL target triple `dxilv1.8-unknown-shader6.8-library` is
constructed when `-T lib_6_8` is specified.
2. When DXIL target triple without DXIL version is specified:
For e.g., DXIL target triple `dxilv1.8-pc-shadermodel6.8-library` is
constructed when `-mtriple=dxil-pc-shadermodel6.8-library` is specified.
Updated relevant HLSL tests that check for target triple.
Validated that Clang (`check-clang`) and LLVM (`check-llvm`) regression
tests pass.
Diffstat (limited to 'clang/unittests/Driver')
-rw-r--r-- | clang/unittests/Driver/DXCModeTest.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/clang/unittests/Driver/DXCModeTest.cpp b/clang/unittests/Driver/DXCModeTest.cpp index b3767c0..416723d 100644 --- a/clang/unittests/Driver/DXCModeTest.cpp +++ b/clang/unittests/Driver/DXCModeTest.cpp @@ -68,25 +68,27 @@ TEST(DxcModeTest, TargetProfileValidation) { IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer); - validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex", + validateTargetProfile("-Tvs_6_0", "dxilv1.0--shadermodel6.0-vertex", InMemoryFileSystem, Diags); - validateTargetProfile("-Ths_6_1", "dxil--shadermodel6.1-hull", + validateTargetProfile("-Ths_6_1", "dxilv1.1--shadermodel6.1-hull", InMemoryFileSystem, Diags); - validateTargetProfile("-Tds_6_2", "dxil--shadermodel6.2-domain", + validateTargetProfile("-Tds_6_2", "dxilv1.2--shadermodel6.2-domain", InMemoryFileSystem, Diags); - validateTargetProfile("-Tds_6_2", "dxil--shadermodel6.2-domain", + validateTargetProfile("-Tds_6_2", "dxilv1.2--shadermodel6.2-domain", InMemoryFileSystem, Diags); - validateTargetProfile("-Tgs_6_3", "dxil--shadermodel6.3-geometry", + validateTargetProfile("-Tgs_6_3", "dxilv1.3--shadermodel6.3-geometry", InMemoryFileSystem, Diags); - validateTargetProfile("-Tps_6_4", "dxil--shadermodel6.4-pixel", + validateTargetProfile("-Tps_6_4", "dxilv1.4--shadermodel6.4-pixel", InMemoryFileSystem, Diags); - validateTargetProfile("-Tcs_6_5", "dxil--shadermodel6.5-compute", + validateTargetProfile("-Tcs_6_5", "dxilv1.5--shadermodel6.5-compute", InMemoryFileSystem, Diags); - validateTargetProfile("-Tms_6_6", "dxil--shadermodel6.6-mesh", + validateTargetProfile("-Tms_6_6", "dxilv1.6--shadermodel6.6-mesh", InMemoryFileSystem, Diags); - validateTargetProfile("-Tas_6_7", "dxil--shadermodel6.7-amplification", + validateTargetProfile("-Tas_6_7", "dxilv1.7--shadermodel6.7-amplification", InMemoryFileSystem, Diags); - validateTargetProfile("-Tlib_6_x", "dxil--shadermodel6.15-library", + validateTargetProfile("-Tcs_6_8", "dxilv1.8--shadermodel6.8-compute", + InMemoryFileSystem, Diags); + validateTargetProfile("-Tlib_6_x", "dxilv1.8--shadermodel6.15-library", InMemoryFileSystem, Diags); // Invalid tests. |