From 4dedc35e8f94366a50ed9f9dbf517b5af818268f Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 5 May 2021 12:18:53 +0200 Subject: [PATCH] Fixed tests: Added query for D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT Closes #12 --- src/Tests.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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))