Skip to content

Commit 4540839

Browse files
authored
Add D3D_FEATURE_LEVEL_12_2 (#636)
1 parent 708741e commit 4540839

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

Graphics/GraphicsEngineD3D11/include/pch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969

7070
#include "WinHPostface.h"
7171

72+
#ifndef NTDDI_WIN10_FE // First defined in Win SDK 10.0.20348.0
73+
constexpr D3D_FEATURE_LEVEL D3D_FEATURE_LEVEL_12_2 = static_cast<D3D_FEATURE_LEVEL>(0xc200);
74+
#endif
75+
7276
#include "Errors.hpp"
7377
#include "RefCntAutoPtr.hpp"
7478
#include "DebugUtilities.hpp"

Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ static const ShaderVersion HLSLValidateShaderVersion(const ShaderVersion& Versio
5454

5555
static const ShaderVersion GetD3D11ShaderModel(D3D_FEATURE_LEVEL d3dDeviceFeatureLevel, const ShaderVersion& HLSLVersion)
5656
{
57+
#if defined(_MSC_VER) && !defined(NTDDI_WIN10_FE)
58+
# pragma warning(disable : 4063)
59+
#endif
5760
switch (d3dDeviceFeatureLevel)
5861
{
5962
// Direct3D11 only supports shader model 5.0 even if the device feature level is
6063
// above 11.0 (for example, 11.1 or 12.0).
6164
// https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro#overview-for-each-feature-level
6265
#if defined(_WIN32_WINNT_WIN10) && (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
66+
case D3D_FEATURE_LEVEL_12_2:
6367
case D3D_FEATURE_LEVEL_12_1:
6468
case D3D_FEATURE_LEVEL_12_0:
6569
#endif
@@ -83,6 +87,9 @@ static const ShaderVersion GetD3D11ShaderModel(D3D_FEATURE_LEVEL d3dDeviceFeatur
8387
UNEXPECTED("Unexpected D3D feature level ", static_cast<Uint32>(d3dDeviceFeatureLevel));
8488
return ShaderVersion{4, 0};
8589
}
90+
#if defined(_MSC_VER) && !defined(NTDDI_WIN10_FE)
91+
# pragma warning(default : 4063)
92+
#endif
8693
}
8794

8895
ShaderD3D11Impl::ShaderD3D11Impl(IReferenceCounters* pRefCounters,

Graphics/GraphicsEngineD3D12/include/pch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444

4545
#include "WinHPostface.h"
4646

47+
#ifndef NTDDI_WIN10_FE // First defined in Win SDK 10.0.20348.0
48+
constexpr D3D_FEATURE_LEVEL D3D_FEATURE_LEVEL_12_2 = static_cast<D3D_FEATURE_LEVEL>(0xc200);
49+
#endif
50+
4751
#ifndef NTDDI_WIN10_VB // First defined in Win SDK 10.0.19041.0
4852
# define D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS static_cast<D3D12_INDIRECT_ARGUMENT_TYPE>(D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW + 1)
4953
# define D3D12_RAYTRACING_TIER_1_1 static_cast<D3D12_RAYTRACING_TIER>(11)

Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ D3D_FEATURE_LEVEL GetD3DFeatureLevelFromDevice(ID3D12Device* pd3d12Device)
6969
{
7070
D3D_FEATURE_LEVEL FeatureLevels[] =
7171
{
72+
D3D_FEATURE_LEVEL_12_2,
7273
D3D_FEATURE_LEVEL_12_1,
7374
D3D_FEATURE_LEVEL_12_0,
7475
D3D_FEATURE_LEVEL_11_1,
@@ -175,8 +176,12 @@ RenderDeviceD3D12Impl::RenderDeviceD3D12Impl(IReferenceCounters* pRefCo
175176
m_DeviceInfo.Features = EnableDeviceFeatures(m_AdapterInfo.Features, EngineCI.Features);
176177

177178
auto FeatureLevel = GetD3DFeatureLevelFromDevice(m_pd3d12Device);
179+
#if defined(_MSC_VER) && !defined(NTDDI_WIN10_FE)
180+
# pragma warning(disable : 4063)
181+
#endif
178182
switch (FeatureLevel)
179183
{
184+
case D3D_FEATURE_LEVEL_12_2: m_DeviceInfo.APIVersion = {12, 2}; break;
180185
case D3D_FEATURE_LEVEL_12_1: m_DeviceInfo.APIVersion = {12, 1}; break;
181186
case D3D_FEATURE_LEVEL_12_0: m_DeviceInfo.APIVersion = {12, 0}; break;
182187
case D3D_FEATURE_LEVEL_11_1: m_DeviceInfo.APIVersion = {11, 1}; break;
@@ -185,6 +190,9 @@ RenderDeviceD3D12Impl::RenderDeviceD3D12Impl(IReferenceCounters* pRefCo
185190
case D3D_FEATURE_LEVEL_10_0: m_DeviceInfo.APIVersion = {10, 0}; break;
186191
default: UNEXPECTED("Unexpected D3D feature level");
187192
}
193+
#if defined(_MSC_VER) && !defined(NTDDI_WIN10_FE)
194+
# pragma warning(default : 4063)
195+
#endif
188196

189197
// Detect maximum shader model.
190198
{

Graphics/GraphicsEngineD3DBase/include/EngineFactoryD3DBase.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ class EngineFactoryD3DBase : public EngineFactoryBase<BaseInterface>
295295
{
296296
case 0: VERIFY_EXPR(FeatureLevel == D3D_FEATURE_LEVEL_12_0); break;
297297
case 1: VERIFY_EXPR(FeatureLevel == D3D_FEATURE_LEVEL_12_1); break;
298+
case 2: VERIFY_EXPR(FeatureLevel == D3D_FEATURE_LEVEL_12_2); break;
298299
default: UNEXPECTED("unknown feature level 12.", Uint32{MinVersion.Minor});
299300
}
300301
break;

0 commit comments

Comments
 (0)