Skip to content

Commit bcb1bca

Browse files
Make minimum required SDK be version 26100 (microsoft#7939)
Previously, the minimum required Windows SDK was version either 17763 or 18362 (depending on where you looked). Neither of these SDKs are still supported - see https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ This change updates the minimum required SDK to be the currently supported version, 26100, and removes the workarounds that were in place to support compiling on older SDKs. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 833f91f commit bcb1bca

File tree

7 files changed

+21
-348
lines changed

7 files changed

+21
-348
lines changed

docs/BuildingAndTestingDXC.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Building on windows additionally requires:
3636
* [Visual Studio 2019 or later](https://www.visualstudio.com/downloads) - select the following workloads:
3737
* Universal Windows Platform Development
3838
* Desktop Development with C++
39-
* [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk) - version 10.0.18362.0 or newer
39+
* [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-sdk) - version 10.0.26100.0 or newer
4040
* [Windows Driver Kit](https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) - same version as the SDK
4141

4242
Note: DXC uses submodules for some external dependencies. You must initialize

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 1 addition & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -185,53 +185,6 @@ static void SavePixelsToFile(LPCVOID pPixels, DXGI_FORMAT format,
185185
VERIFY_SUCCEEDED(pStream->Commit(STGC_DEFAULT));
186186
}
187187

188-
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS2
189-
#define D3D12_FEATURE_D3D12_OPTIONS3 ((D3D12_FEATURE)21)
190-
#define NTDDI_WIN10_RS3 0x0A000004 /* ABRACADABRA_WIN10_RS2 */
191-
typedef enum D3D12_COMMAND_LIST_SUPPORT_FLAGS {
192-
D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0,
193-
D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT =
194-
(1 << D3D12_COMMAND_LIST_TYPE_DIRECT),
195-
D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE =
196-
(1 << D3D12_COMMAND_LIST_TYPE_BUNDLE),
197-
D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE =
198-
(1 << D3D12_COMMAND_LIST_TYPE_COMPUTE),
199-
D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = (1 << D3D12_COMMAND_LIST_TYPE_COPY),
200-
D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = (1 << 4),
201-
D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = (1 << 5)
202-
} D3D12_COMMAND_LIST_SUPPORT_FLAGS;
203-
204-
typedef enum D3D12_VIEW_INSTANCING_TIER {
205-
D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0,
206-
D3D12_VIEW_INSTANCING_TIER_1 = 1,
207-
D3D12_VIEW_INSTANCING_TIER_2 = 2,
208-
D3D12_VIEW_INSTANCING_TIER_3 = 3
209-
} D3D12_VIEW_INSTANCING_TIER;
210-
211-
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 {
212-
BOOL CopyQueueTimestampQueriesSupported;
213-
BOOL CastingFullyTypedFormatSupported;
214-
DWORD WriteBufferImmediateSupportFlags;
215-
D3D12_VIEW_INSTANCING_TIER ViewInstancingTier;
216-
BOOL BarycentricsSupported;
217-
} D3D12_FEATURE_DATA_D3D12_OPTIONS3;
218-
#endif
219-
220-
#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS3
221-
#define D3D12_FEATURE_D3D12_OPTIONS4 ((D3D12_FEATURE)23)
222-
typedef enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER {
223-
D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0,
224-
D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1,
225-
} D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER;
226-
227-
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4 {
228-
BOOL ReservedBufferPlacementSupported;
229-
3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier;
230-
BOOL Native16BitShaderOpsSupported;
231-
} D3D12_FEATURE_DATA_D3D12_OPTIONS4;
232-
233-
#endif
234-
235188
class ExecutionTest {
236189
public:
237190
BEGIN_TEST_CLASS(ExecutionTest)
@@ -874,7 +827,6 @@ class ExecutionTest {
874827
}
875828
}
876829

877-
#if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
878830
// Copy common fields from desc0 to desc1 and zero out the new one
879831
void CopyDesc0ToDesc1(D3D12_RESOURCE_DESC1 &desc1,
880832
const D3D12_RESOURCE_DESC &desc0) {
@@ -890,7 +842,6 @@ class ExecutionTest {
890842
desc1.Flags = desc0.Flags;
891843
desc1.SamplerFeedbackMipRegion = {};
892844
}
893-
#endif
894845

895846
// Create resources for the given <resDesc> described main resource
896847
// creating and returning the resource, the upload resource,
@@ -924,7 +875,6 @@ class ExecutionTest {
924875
nullptr, nullptr, &uploadBufferDesc.Width);
925876
uploadBufferDesc.Height = 1;
926877

927-
#if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
928878
if (castFormat) {
929879
CComPtr<ID3D12Device10> pDevice10;
930880
// Copy resDesc0 to resDesc1 zeroing anything new
@@ -936,11 +886,7 @@ class ExecutionTest {
936886
&defaultHeapProperties, D3D12_HEAP_FLAG_NONE, &resDesc1,
937887
D3D12_BARRIER_LAYOUT_COPY_DEST, nullptr, nullptr, 1, castFormat,
938888
IID_PPV_ARGS(&pResource)));
939-
} else
940-
#else
941-
UNREFERENCED_PARAMETER(castFormat);
942-
#endif
943-
{
889+
} else {
944890
VERIFY_SUCCEEDED(pDevice->CreateCommittedResource(
945891
&defaultHeapProperties, D3D12_HEAP_FLAG_NONE, &resDesc,
946892
D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&pResource)));
@@ -1318,33 +1264,22 @@ class ExecutionTest {
13181264
}
13191265

13201266
bool DoesDeviceSupportMeshShaders(ID3D12Device *pDevice) {
1321-
#if defined(NTDDI_WIN10_VB) && WDK_NTDDI_VERSION >= NTDDI_WIN10_VB
13221267
D3D12_FEATURE_DATA_D3D12_OPTIONS7 O7;
13231268
if (FAILED(pDevice->CheckFeatureSupport(
13241269
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS7, &O7, sizeof(O7))))
13251270
return false;
13261271
return O7.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED;
1327-
#else
1328-
UNREFERENCED_PARAMETER(pDevice);
1329-
return false;
1330-
#endif
13311272
}
13321273

13331274
bool DoesDeviceSupportRayTracing(ID3D12Device *pDevice) {
1334-
#if WDK_NTDDI_VERSION > NTDDI_WIN10_RS4
13351275
D3D12_FEATURE_DATA_D3D12_OPTIONS5 O5;
13361276
if (FAILED(pDevice->CheckFeatureSupport(
13371277
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS5, &O5, sizeof(O5))))
13381278
return false;
13391279
return O5.RaytracingTier != D3D12_RAYTRACING_TIER_NOT_SUPPORTED;
1340-
#else
1341-
UNREFERENCED_PARAMETER(pDevice);
1342-
return false;
1343-
#endif
13441280
}
13451281

13461282
bool DoesDeviceSupportMeshAmpDerivatives(ID3D12Device *pDevice) {
1347-
#if defined(NTDDI_WIN10_FE) && WDK_NTDDI_VERSION >= NTDDI_WIN10_FE
13481283
D3D12_FEATURE_DATA_D3D12_OPTIONS7 O7;
13491284
D3D12_FEATURE_DATA_D3D12_OPTIONS9 O9;
13501285
if (FAILED(pDevice->CheckFeatureSupport(
@@ -1354,92 +1289,57 @@ class ExecutionTest {
13541289
return false;
13551290
return O7.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED &&
13561291
O9.DerivativesInMeshAndAmplificationShadersSupported != FALSE;
1357-
#else
1358-
UNREFERENCED_PARAMETER(pDevice);
1359-
return false;
1360-
#endif
13611292
}
13621293

13631294
bool DoesDeviceSupportTyped64Atomics(ID3D12Device *pDevice) {
1364-
#if defined(NTDDI_WIN10_FE) && WDK_NTDDI_VERSION >= NTDDI_WIN10_FE
13651295
D3D12_FEATURE_DATA_D3D12_OPTIONS9 O9;
13661296
if (FAILED(pDevice->CheckFeatureSupport(
13671297
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS9, &O9, sizeof(O9))))
13681298
return false;
13691299
return O9.AtomicInt64OnTypedResourceSupported != FALSE;
1370-
#else
1371-
UNREFERENCED_PARAMETER(pDevice);
1372-
return false;
1373-
#endif
13741300
}
13751301

13761302
bool DoesDeviceSupportHeap64Atomics(ID3D12Device *pDevice) {
1377-
#if defined(NTDDI_WIN10_CO) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CO
13781303
D3D12_FEATURE_DATA_D3D12_OPTIONS11 O11;
13791304
if (FAILED(pDevice->CheckFeatureSupport(
13801305
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS11, &O11, sizeof(O11))))
13811306
return false;
13821307
return O11.AtomicInt64OnDescriptorHeapResourceSupported != FALSE;
1383-
#else
1384-
UNREFERENCED_PARAMETER(pDevice);
1385-
return false;
1386-
#endif
13871308
}
13881309

13891310
bool DoesDeviceSupportShared64Atomics(ID3D12Device *pDevice) {
1390-
#if defined(NTDDI_WIN10_FE) && WDK_NTDDI_VERSION >= NTDDI_WIN10_FE
13911311
D3D12_FEATURE_DATA_D3D12_OPTIONS9 O9;
13921312
if (FAILED(pDevice->CheckFeatureSupport(
13931313
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS9, &O9, sizeof(O9))))
13941314
return false;
13951315
return O9.AtomicInt64OnGroupSharedSupported != FALSE;
1396-
#else
1397-
UNREFERENCED_PARAMETER(pDevice);
1398-
return false;
1399-
#endif
14001316
}
14011317

14021318
bool DoesDeviceSupportAdvancedTexOps(ID3D12Device *pDevice) {
1403-
#if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
14041319
D3D12_FEATURE_DATA_D3D12_OPTIONS14 O14;
14051320
if (FAILED(pDevice->CheckFeatureSupport(
14061321
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS14, &O14, sizeof(O14))))
14071322
return false;
14081323
return O14.AdvancedTextureOpsSupported != FALSE;
1409-
#else
1410-
UNREFERENCED_PARAMETER(pDevice);
1411-
return false;
1412-
#endif
14131324
}
14141325

14151326
bool DoesDeviceSupportWritableMSAA(ID3D12Device *pDevice) {
1416-
#if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
14171327
D3D12_FEATURE_DATA_D3D12_OPTIONS14 O14;
14181328
if (FAILED(pDevice->CheckFeatureSupport(
14191329
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS14, &O14, sizeof(O14))))
14201330
return false;
14211331
return O14.WriteableMSAATexturesSupported != FALSE;
1422-
#else
1423-
UNREFERENCED_PARAMETER(pDevice);
1424-
return false;
1425-
#endif
14261332
}
14271333

14281334
bool DoesDeviceSupportEnhancedBarriers(ID3D12Device *pDevice) {
1429-
#if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
14301335
D3D12_FEATURE_DATA_D3D12_OPTIONS12 O12;
14311336
if (FAILED(pDevice->CheckFeatureSupport(
14321337
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS12, &O12, sizeof(O12))))
14331338
return false;
14341339
return O12.EnhancedBarriersSupported != FALSE;
1435-
#else
1436-
UNREFERENCED_PARAMETER(pDevice);
1437-
return false;
1438-
#endif
14391340
}
14401341

14411342
bool DoesDeviceSupportRelaxedFormatCasting(ID3D12Device *pDevice) {
1442-
#if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU
14431343
D3D12_FEATURE_DATA_D3D12_OPTIONS12 O12;
14441344
if (!DoesDeviceSupportEnhancedBarriers(pDevice))
14451345
return false;
@@ -1448,10 +1348,6 @@ class ExecutionTest {
14481348
(D3D12_FEATURE)D3D12_FEATURE_D3D12_OPTIONS12, &O12, sizeof(O12))))
14491349
return false;
14501350
return O12.RelaxedFormatCastingSupported != FALSE;
1451-
#else
1452-
UNREFERENCED_PARAMETER(pDevice);
1453-
return false;
1454-
#endif
14551351
}
14561352

14571353
bool IsFallbackPathEnabled() {

tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,6 @@ static bool useWarpByDefault() {
2929
#endif
3030
}
3131

32-
// A more recent Windows SDK than currently required is needed for these.
33-
typedef HRESULT(WINAPI *D3D12EnableExperimentalFeaturesFn)(
34-
UINT NumFeatures, __in_ecount(NumFeatures) const IID *IIDs,
35-
__in_ecount_opt(NumFeatures) void *ConfigurationStructs,
36-
__in_ecount_opt(NumFeatures) UINT *ConfigurationStructSizes);
37-
38-
static const GUID D3D12ExperimentalShaderModelsID =
39-
{/* 76f5573e-f13a-40f5-b297-81ce9e18933f */
40-
0x76f5573e,
41-
0xf13a,
42-
0x40f5,
43-
{0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f}};
44-
45-
// Used to create D3D12SDKConfiguration to enable AgilitySDK programmatically.
46-
typedef HRESULT(WINAPI *D3D12GetInterfaceFn)(REFCLSID Rclsid, REFIID Riid,
47-
void **Debug);
48-
49-
#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__
50-
51-
// Copied from AgilitySDK D3D12.h to programmatically enable when in developer
52-
// mode.
53-
#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__
54-
55-
EXTERN_C const GUID DECLSPEC_SELECTANY IID_ID3D12SDKConfiguration = {
56-
0xe9eb5314,
57-
0x33aa,
58-
0x42b2,
59-
{0xa7, 0x18, 0xd7, 0x7f, 0x58, 0xb1, 0xf1, 0xc7}};
60-
EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_D3D12SDKConfiguration = {
61-
0x7cda6aca,
62-
0xa03e,
63-
0x49c8,
64-
{0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce}};
65-
66-
MIDL_INTERFACE("e9eb5314-33aa-42b2-a718-d77f58b1f1c7")
67-
ID3D12SDKConfiguration : public IUnknown {
68-
public:
69-
virtual HRESULT STDMETHODCALLTYPE SetSDKVersion(UINT SDKVersion,
70-
LPCSTR SDKPath) = 0;
71-
};
72-
#endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */
73-
7432
static std::wstring getModuleName() {
7533
wchar_t ModuleName[MAX_PATH + 1] = {0};
7634
const DWORD Length = GetModuleFileNameW(NULL, ModuleName, MAX_PATH);
@@ -262,8 +220,8 @@ void readHlslDataIntoNewStream(LPCWSTR RelativePath, IStream **Stream,
262220

263221
static HRESULT enableAgilitySDK(HMODULE Runtime, UINT SDKVersion,
264222
LPCWSTR SDKPath) {
265-
D3D12GetInterfaceFn GetInterfaceFunc =
266-
(D3D12GetInterfaceFn)GetProcAddress(Runtime, "D3D12GetInterface");
223+
auto GetInterfaceFunc = reinterpret_cast<decltype(&D3D12GetInterface)>(
224+
GetProcAddress(Runtime, "D3D12GetInterface"));
267225
CComPtr<ID3D12SDKConfiguration> D3D12SDKConfiguration;
268226
IFR(GetInterfaceFunc(CLSID_D3D12SDKConfiguration,
269227
IID_PPV_ARGS(&D3D12SDKConfiguration)));
@@ -276,9 +234,9 @@ static HRESULT enableAgilitySDK(HMODULE Runtime, UINT SDKVersion,
276234
// features next, which is a valid use case and a no-op at this point. This
277235
// requires D3D12Core to be loaded. If this fails, we know the AgilitySDK
278236
// setting actually failed.
279-
D3D12EnableExperimentalFeaturesFn ExperimentalFeaturesFunc =
280-
(D3D12EnableExperimentalFeaturesFn)GetProcAddress(
281-
Runtime, "D3D12EnableExperimentalFeatures");
237+
auto ExperimentalFeaturesFunc =
238+
reinterpret_cast<decltype(&D3D12EnableExperimentalFeatures)>(
239+
GetProcAddress(Runtime, "D3D12EnableExperimentalFeatures"));
282240
if (ExperimentalFeaturesFunc == nullptr)
283241
// If this failed, D3D12 must be too old for AgilitySDK. But if that's
284242
// the case, creating D3D12SDKConfiguration should have failed. So while
@@ -292,15 +250,15 @@ static HRESULT
292250
enableExperimentalShaderModels(HMODULE hRuntime,
293251
UUID AdditionalFeatures[] = nullptr,
294252
size_t NumAdditionalFeatures = 0) {
295-
D3D12EnableExperimentalFeaturesFn ExperimentalFeaturesFunc =
296-
(D3D12EnableExperimentalFeaturesFn)GetProcAddress(
297-
hRuntime, "D3D12EnableExperimentalFeatures");
253+
auto ExperimentalFeaturesFunc =
254+
reinterpret_cast<decltype(&D3D12EnableExperimentalFeatures)>(
255+
GetProcAddress(hRuntime, "D3D12EnableExperimentalFeatures"));
298256
if (ExperimentalFeaturesFunc == nullptr)
299257
return HRESULT_FROM_WIN32(GetLastError());
300258

301259
std::vector<UUID> Features;
302260

303-
Features.push_back(D3D12ExperimentalShaderModelsID);
261+
Features.push_back(D3D12ExperimentalShaderModels);
304262

305263
if (AdditionalFeatures != nullptr && NumAdditionalFeatures > 0)
306264
Features.insert(Features.end(), AdditionalFeatures,

tools/clang/unittests/HLSLExec/ShaderOpTest.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,7 @@ void ShaderOpTest::CreatePipelineState() {
469469
InitByteCode(&CDesc.CS, pCS);
470470
CHECK_HR(
471471
m_pDevice->CreateComputePipelineState(&CDesc, IID_PPV_ARGS(&m_pPSO)));
472-
}
473-
// Wakanda technology, needs vibranium to work
474-
#if defined(NTDDI_WIN10_VB) && WDK_NTDDI_VERSION >= NTDDI_WIN10_VB
475-
else if (m_pShaderOp->MS) {
472+
} else if (m_pShaderOp->MS) {
476473
// A couple types from a future version of d3dx12.h
477474
typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT<
478475
D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS>
@@ -536,9 +533,7 @@ void ShaderOpTest::CreatePipelineState() {
536533
CHECK_HR(m_pDevice->QueryInterface(&pDevice2));
537534

538535
CHECK_HR(pDevice2->CreatePipelineState(&PDesc, IID_PPV_ARGS(&m_pPSO)));
539-
}
540-
#endif
541-
else {
536+
} else {
542537
CComPtr<ID3D10Blob> pVS, pDS, pHS, pGS, pPS;
543538
pPS = map_get_or_null(m_Shaders, m_pShaderOp->PS);
544539
pVS = map_get_or_null(m_Shaders, m_pShaderOp->VS);
@@ -1002,7 +997,6 @@ void ShaderOpTest::RunCommandList() {
1002997
const float ClearColor[4] = {0.0f, 0.2f, 0.4f, 1.0f};
1003998
pList->ClearRenderTargetView(rtvHandles[0], ClearColor, 0, nullptr);
1004999

1005-
#if defined(NTDDI_WIN10_VB) && WDK_NTDDI_VERSION >= NTDDI_WIN10_VB
10061000
if (m_pShaderOp->MS) {
10071001
#ifndef NDEBUG
10081002
D3D12_FEATURE_DATA_D3D12_OPTIONS7 O7;
@@ -1020,9 +1014,7 @@ void ShaderOpTest::RunCommandList() {
10201014
pList6->ResolveQueryData(m_pQueryHeap,
10211015
D3D12_QUERY_TYPE_PIPELINE_STATISTICS, 0, 1,
10221016
m_pQueryBuffer, 0);
1023-
} else
1024-
#endif
1025-
{
1017+
} else {
10261018
// TODO: set all of this from m_pShaderOp.
10271019
ShaderOpResourceData &VBufferData =
10281020
this->m_ResourceData[m_pShaderOp->Strings.insert("VBuffer")];

0 commit comments

Comments
 (0)