Skip to content

Commit 6b8d715

Browse files
author
Greg Roth
authored
Exec test - WAR SM feature check on older runtime (#3605)
Merge #3603 into release-1.6.2104 An earlier version of the D3D runtime doesn't handle CheckFeatureSupport for FEATURE_SHADER_MODEL when the corresponding struct is set to a unrecognized shader model. Instead of returning the highest supported shader model that is less than the one provided as documented, the call fails. In practice, this only occurred for 6.6 tests where the SDK had 6.6 capability, but the installed runtime did not. To work around this, we don't verify that the call succeeds. Instead, a failing return result is interpretted the same way as a highest shader model value that is lower than that requested. (cherry picked from commit ddde121)
1 parent fd963ca commit 6b8d715

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/clang/unittests/HLSL/ExecutionTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ class ExecutionTest {
702702
const UINT D3D12_FEATURE_SHADER_MODEL = 7;
703703
D3D12_FEATURE_DATA_SHADER_MODEL SMData;
704704
SMData.HighestShaderModel = testModel;
705-
VERIFY_SUCCEEDED(pDevice->CheckFeatureSupport(
706-
(D3D12_FEATURE)D3D12_FEATURE_SHADER_MODEL, &SMData, sizeof(SMData)));
707-
if (SMData.HighestShaderModel < testModel) {
705+
if (FAILED(pDevice->CheckFeatureSupport((D3D12_FEATURE)D3D12_FEATURE_SHADER_MODEL,
706+
&SMData, sizeof(SMData))) ||
707+
SMData.HighestShaderModel < testModel) {
708708
UINT minor = (UINT)testModel & 0x0f;
709709
LogCommentFmt(L"The selected device does not support "
710710
L"shader model 6.%1u", minor);

0 commit comments

Comments
 (0)