Skip to content

Commit 8d34720

Browse files
authored
[SM6.10][Bugfix][HLK] Only define SDK consts when missing (#8341)
Several const values are needed for test development before they are in the SDK, however defining them prevents the actual updated SDK from being used. Add guards so that the values are only defined when they aren't expected to be defined but they SDK
1 parent 0131a62 commit 8d34720

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
// D3D12_FEATURE_D3D12_OPTIONS_PREVIEW and its data struct are not yet in
1616
// the released Windows SDK. Define locally so the test can query variable
1717
// group shared memory capabilities from the Agility SDK runtime.
18-
// Once the public SDK ships with these, a compile break (redefinition error)
19-
// will signal that these local definitions should be removed.
18+
// This should be removed once widely supported.
19+
#if defined(D3D12_PREVIEW_SDK_VERSION) && D3D12_PREVIEW_SDK_VERSION < 720
20+
2021
#ifndef D3D12_FEATURE_D3D12_OPTIONS_PREVIEW
2122
#define D3D12_FEATURE_D3D12_OPTIONS_PREVIEW ((D3D12_FEATURE)72)
2223
#endif
@@ -27,6 +28,8 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW {
2728
UINT MaxGroupSharedMemoryPerGroupMS;
2829
} D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW;
2930

31+
#endif
32+
3033
using namespace hlsl_test;
3134

3235
static bool useDebugIfaces() { return true; }

tools/clang/unittests/HLSLExec/HlslExecTestUtils.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
#include "ShaderOpTest.h"
1212
#include "dxc/Support/dxcapi.use.h"
1313

14-
// D3D_SHADER_MODEL_6_10 is not yet in the released Windows SDK.
15-
// Define locally so the tests can target SM 6.10.
16-
// Once the public SDK ships with this, a compile break (redefinition error)
17-
// will signal that this local definition should be removed.
14+
// D3D_SHADER_MODEL_6_10 is not yet in the released Windows SDK. Define locally
15+
// so the test can query 6.10 driver support. This should be removed once
16+
// widely supported.
17+
#if defined(D3D12_PREVIEW_SDK_VERSION) && D3D12_PREVIEW_SDK_VERSION < 720
1818
static const D3D_SHADER_MODEL D3D_SHADER_MODEL_6_10 = (D3D_SHADER_MODEL)0x6a;
19+
#endif
1920

2021
// Local highest shader model known to DXC. Update this when adding support
2122
// for new shader models. Unlike D3D_HIGHEST_SHADER_MODEL from the SDK,

0 commit comments

Comments
 (0)