[PATCH vkd3d 03/10] tests: Add a test for 0 sample count resources to test_create_committed_resource().

Henri Verbeet hverbeet at codeweavers.com
Thu Oct 14 18:37:39 CDT 2021


From: Conor McCarthy <cmccarthy at codeweavers.com>

Windows returns E_INVALIDARG at least on AMD and Intel.
Psychonauts 2 attempts to create resources with this argument.

Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
v2: Minor style changes.
This supersedes patch 214666.

 tests/d3d12.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/d3d12.c b/tests/d3d12.c
index e6461e31..4a7309d6 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -1700,6 +1700,14 @@ static void test_create_committed_resource(void)
     ID3D12Resource_Release(resource);
     resource_desc.MipLevels = 1;
 
+    resource_desc.SampleDesc.Count = 0;
+    hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc,
+            D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, &IID_ID3D12Resource, (void **)&resource);
+    todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+    if (SUCCEEDED(hr))
+        ID3D12Resource_Release(resource);
+    resource_desc.SampleDesc.Count = 1;
+
     hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
             &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE,
             &clear_value, &IID_ID3D12Resource, (void **)&resource);
-- 
2.20.1




More information about the wine-devel mailing list