Skip to content

Commit 358918f

Browse files
authored
Remove artificial FL12 requirement for CreateDevice (#3633) (#3635)
(cherry picked from commit 6e0f1f9)
1 parent 285f6d5 commit 358918f

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

tools/clang/unittests/HLSL/ExecutionTest.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,7 @@ class ExecutionTest {
633633
}
634634

635635
bool CreateDevice(_COM_Outptr_ ID3D12Device **ppDevice,
636-
D3D_SHADER_MODEL testModel = D3D_SHADER_MODEL_6_0, bool skipUnsupported = true,
637-
bool enableRayTracing = false) {
636+
D3D_SHADER_MODEL testModel = D3D_SHADER_MODEL_6_0, bool skipUnsupported = true) {
638637
if (testModel > HIGHEST_SHADER_MODEL) {
639638
UINT minor = (UINT)testModel & 0x0f;
640639
LogCommentFmt(L"Installed SDK does not support "
@@ -646,7 +645,6 @@ class ExecutionTest {
646645

647646
return false;
648647
}
649-
const D3D_FEATURE_LEVEL FeatureLevelRequired = enableRayTracing ? D3D_FEATURE_LEVEL_12_0 : D3D_FEATURE_LEVEL_11_0;
650648
CComPtr<IDXGIFactory4> factory;
651649
CComPtr<ID3D12Device> pDevice;
652650

@@ -656,7 +654,7 @@ class ExecutionTest {
656654
if (GetTestParamUseWARP(UseWarpByDefault())) {
657655
CComPtr<IDXGIAdapter> warpAdapter;
658656
VERIFY_SUCCEEDED(factory->EnumWarpAdapter(IID_PPV_ARGS(&warpAdapter)));
659-
HRESULT createHR = D3D12CreateDevice(warpAdapter, FeatureLevelRequired,
657+
HRESULT createHR = D3D12CreateDevice(warpAdapter, D3D_FEATURE_LEVEL_11_0,
660658
IID_PPV_ARGS(&pDevice));
661659
if (FAILED(createHR)) {
662660
LogCommentFmt(L"The available version of WARP does not support d3d12.");
@@ -678,7 +676,7 @@ class ExecutionTest {
678676
WEX::Logging::Log::Comment(
679677
L"Using default hardware adapter with D3D12 support.");
680678
}
681-
VERIFY_SUCCEEDED(D3D12CreateDevice(hardwareAdapter, FeatureLevelRequired,
679+
VERIFY_SUCCEEDED(D3D12CreateDevice(hardwareAdapter, D3D_FEATURE_LEVEL_11_0,
682680
IID_PPV_ARGS(&pDevice)));
683681
}
684682
// retrieve adapter information
@@ -1777,15 +1775,15 @@ TEST_F(ExecutionTest, LifetimeIntrinsicTest) {
17771775
static const int DispatchGroupCount = 1;
17781776

17791777
CComPtr<ID3D12Device> pDevice;
1780-
bool bSM_6_6_Supported = CreateDevice(&pDevice, D3D_SHADER_MODEL_6_6, false, true);
1778+
bool bSM_6_6_Supported = CreateDevice(&pDevice, D3D_SHADER_MODEL_6_6, false);
17811779
bool bSM_6_3_Supported = bSM_6_6_Supported;
17821780
if (!bSM_6_6_Supported) {
17831781
// Try 6.3 for downlevel DXR case
1784-
bSM_6_3_Supported = CreateDevice(&pDevice, D3D_SHADER_MODEL_6_3, false, true);
1782+
bSM_6_3_Supported = CreateDevice(&pDevice, D3D_SHADER_MODEL_6_3, false);
17851783
}
17861784
if (!bSM_6_3_Supported) {
17871785
// Otherwise, 6.0 better be supported for compute case
1788-
VERIFY_IS_TRUE(CreateDevice(&pDevice, D3D_SHADER_MODEL_6_0, false, false));
1786+
VERIFY_IS_TRUE(CreateDevice(&pDevice, D3D_SHADER_MODEL_6_0, false));
17891787
}
17901788
bool bDXRSupported = bSM_6_3_Supported && DoesDeviceSupportRayTracing(pDevice);
17911789

0 commit comments

Comments
 (0)