From 3e8b0d4aeb9158405302616f3d89fe55cdf8b290 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Mon, 6 Apr 2026 11:01:24 -0600 Subject: [PATCH 1/2] [SM6.10][Bugfix][HLK] Only define SM6.10 when not provided --- tools/clang/unittests/HLSLExec/HlslExecTestUtils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h index ddbb96b7c1..5cca6eabf5 100644 --- a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h +++ b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h @@ -11,11 +11,11 @@ #include "ShaderOpTest.h" #include "dxc/Support/dxcapi.use.h" -// D3D_SHADER_MODEL_6_10 is not yet in the released Windows SDK. -// Define locally so the tests can target SM 6.10. -// Once the public SDK ships with this, a compile break (redefinition error) -// will signal that this local definition should be removed. +// Define SM6.10 only in the SDK versions where it is not present. This should +// be removed once widely supported. +#if defined(D3D12_PREVIEW_SDK_VERSION) && D3D12_PREVIEW_SDK_VERSION < 720 static const D3D_SHADER_MODEL D3D_SHADER_MODEL_6_10 = (D3D_SHADER_MODEL)0x6a; +#endif // Local highest shader model known to DXC. Update this when adding support // for new shader models. Unlike D3D_HIGHEST_SHADER_MODEL from the SDK, From 48ab549c3c194438672df28fbffe9fba9cd4d882 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Mon, 6 Apr 2026 11:15:18 -0600 Subject: [PATCH 2/2] Missed some defines --- tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp | 7 +++++-- tools/clang/unittests/HLSLExec/HlslExecTestUtils.h | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp index 85cb351afd..10dfc63b37 100644 --- a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp +++ b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp @@ -15,8 +15,9 @@ // D3D12_FEATURE_D3D12_OPTIONS_PREVIEW and its data struct are not yet in // the released Windows SDK. Define locally so the test can query variable // group shared memory capabilities from the Agility SDK runtime. -// Once the public SDK ships with these, a compile break (redefinition error) -// will signal that these local definitions should be removed. +// This should be removed once widely supported. +#if defined(D3D12_PREVIEW_SDK_VERSION) && D3D12_PREVIEW_SDK_VERSION < 720 + #ifndef D3D12_FEATURE_D3D12_OPTIONS_PREVIEW #define D3D12_FEATURE_D3D12_OPTIONS_PREVIEW ((D3D12_FEATURE)72) #endif @@ -27,6 +28,8 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW { UINT MaxGroupSharedMemoryPerGroupMS; } D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW; +#endif + using namespace hlsl_test; static bool useDebugIfaces() { return true; } diff --git a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h index 5cca6eabf5..3e64171478 100644 --- a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h +++ b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h @@ -11,8 +11,9 @@ #include "ShaderOpTest.h" #include "dxc/Support/dxcapi.use.h" -// Define SM6.10 only in the SDK versions where it is not present. This should -// be removed once widely supported. +// D3D_SHADER_MODEL_6_10 is not yet in the released Windows SDK. Define locally +// so the test can query 6.10 driver support. This should be removed once +// widely supported. #if defined(D3D12_PREVIEW_SDK_VERSION) && D3D12_PREVIEW_SDK_VERSION < 720 static const D3D_SHADER_MODEL D3D_SHADER_MODEL_6_10 = (D3D_SHADER_MODEL)0x6a; #endif