From 3ea84156c7692723b624cf47489e94b3aff7aac8 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 29 Apr 2025 21:03:25 +0200 Subject: [PATCH] vkd3d: Validate the fence count in d3d12_device_SetEventOnMultipleFenceCompletion(). --- libs/vkd3d/device.c | 3 +++ tests/d3d12.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 15affcee9..ee1674be3 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -4908,6 +4908,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion( FIXME("iface %p, fences %p, values %p, fence_count %u, flags %#x, event %p stub!\n", iface, fences, values, fence_count, flags, event); + if (!fence_count) + return E_INVALIDARG; + return E_NOTIMPL; } diff --git a/tests/d3d12.c b/tests/d3d12.c index dceb95580..bb3e871fc 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -38969,12 +38969,12 @@ static void test_multi_fence_event(void) /* 0 fence count. */ hr = ID3D12Device1_SetEventOnMultipleFenceCompletion(device1, NULL, NULL, 0, 0, NULL); - todo ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); hr = ID3D12Device1_SetEventOnMultipleFenceCompletion(device1, NULL, NULL, 0, D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY, NULL); - todo ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); hr = ID3D12Device1_SetEventOnMultipleFenceCompletion(device1, fences, fence_values, 0, 0, event); - todo ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); ret = wait_event(event, 0); ok(ret == WAIT_TIMEOUT, "Got ret %#x.\n", ret);