diff --git a/src/Tests.cpp b/src/Tests.cpp index 2d91a1b..f3784be 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -1475,10 +1475,24 @@ static void TestMultithreading(const TestContext& ctx) } } +static bool IsProtectedResourceSessionSupported(const TestContext& ctx) +{ + D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT support = {}; + CHECK_HR(ctx.device->CheckFeatureSupport( + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT, &support, sizeof support)); + return support.Support > D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE; +} + static void TestDevice4(const TestContext& ctx) { wprintf(L"Test ID3D12Device4\n"); + if(!IsProtectedResourceSessionSupported(ctx)) + { + wprintf(L"D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT returned no support for protected resource session.\n"); + return; + } + CComPtr dev4; HRESULT hr = ctx.device->QueryInterface(&dev4); if(FAILED(hr))