Conor McCarthy : tests: Add a test for 0 sample count resources to test_create_committed_resource().

Alexandre Julliard julliard at winehq.org
Fri Oct 15 15:39:49 CDT 2021


Module: vkd3d
Branch: master
Commit: a36dfef00432a5c42ea211f1b0a110c55bffe1d1
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=a36dfef00432a5c42ea211f1b0a110c55bffe1d1

Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date:   Fri Oct 15 01:37:39 2021 +0200

tests: Add a test for 0 sample count resources to test_create_committed_resource().

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/tests/d3d12.c b/tests/d3d12.c
index e6461e3..4a7309d 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);




More information about the wine-cvs mailing list