From e38f3995fdea7e1b0f20a6a715f6d4fe11163b68 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Mon, 5 Feb 2024 13:53:49 +1000 Subject: [PATCH] tests/d3d12: Add tests for GetProtectedResourceSession(). --- tests/d3d12.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index 51ee7877..33efa0f2 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1545,12 +1545,14 @@ static void test_create_command_signature(void) static void test_create_committed_resource(void) { + ID3D12ProtectedResourceSession *protected_session; D3D12_GPU_VIRTUAL_ADDRESS gpu_address; D3D12_HEAP_PROPERTIES heap_properties; D3D12_RESOURCE_DESC resource_desc; ID3D12Device *device, *tmp_device; D3D12_CLEAR_VALUE clear_value; D3D12_RESOURCE_STATES state; + ID3D12Resource1 *resource1; ID3D12Resource *resource; ID3D12Device4 *device4; unsigned int i; @@ -1884,10 +1886,17 @@ static void test_create_committed_resource(void) hr = ID3D12Device4_CreateCommittedResource1(device4, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, NULL, - &IID_ID3D12Resource, (void **)&resource); + &IID_ID3D12Resource1, (void **)&resource1); ok(hr == S_OK, "Failed to create committed resource, hr %#x.\n", hr); - ID3D12Resource_Release(resource); + check_interface(resource1, &IID_ID3D12Resource1, true); + + hr = ID3D12Resource1_GetProtectedResourceSession(resource1, &IID_ID3D12ProtectedResourceSession, + (void **)&protected_session); + todo + ok(hr == DXGI_ERROR_NOT_FOUND, "Got unexpected hr %#x.\n", hr); + + ID3D12Resource1_Release(resource1); ID3D12Device4_Release(device4); } @@ -2140,12 +2149,14 @@ done: static void test_create_placed_resource(void) { + ID3D12ProtectedResourceSession *protected_session; D3D12_GPU_VIRTUAL_ADDRESS gpu_address; ID3D12Resource *resource, *resource2; D3D12_RESOURCE_DESC resource_desc; ID3D12Device *device, *tmp_device; D3D12_CLEAR_VALUE clear_value; D3D12_RESOURCE_STATES state; + ID3D12Resource1 *resource1; D3D12_HEAP_DESC heap_desc; ID3D12Heap *heap; unsigned int i; @@ -2226,6 +2237,15 @@ static void test_create_placed_resource(void) gpu_address = ID3D12Resource_GetGPUVirtualAddress(resource); ok(gpu_address, "Got unexpected GPU virtual address %#"PRIx64".\n", gpu_address); + if (SUCCEEDED(ID3D12Resource_QueryInterface(resource, &IID_ID3D12Resource1, (void **)&resource1))) + { + hr = ID3D12Resource1_GetProtectedResourceSession(resource1, &IID_ID3D12ProtectedResourceSession, + (void **)&protected_session); + todo + ok(hr == DXGI_ERROR_NOT_FOUND, "Got unexpected hr %#x.\n", hr); + ID3D12Resource1_Release(resource1); + } + refcount = ID3D12Resource_Release(resource); ok(!refcount, "ID3D12Resource has %u references left.\n", (unsigned int)refcount);