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 ddbb96b7c1..3e64171478 100644 --- a/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h +++ b/tools/clang/unittests/HLSLExec/HlslExecTestUtils.h @@ -11,11 +11,12 @@ #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. +// 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 // Local highest shader model known to DXC. Update this when adding support // for new shader models. Unlike D3D_HIGHEST_SHADER_MODEL from the SDK,