From a4f5225229577e2376d7d7669227d4ac3c627049 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 25 Jul 2025 21:46:07 +0200 Subject: [PATCH] vkd3d: Return success from d3d12_device_EnumerateMetaCommands(). Signed-off-by: Nikolay Sivov --- libs/vkd3d/device.c | 7 ++++++- tests/d3d12.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index b2636fd55..67f84aafa 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -5193,7 +5193,12 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device FIXME("iface %p, num_meta_commands %p, command_desc %p stub!\n", iface, num_meta_commands, command_desc); - return E_NOTIMPL; + if (!num_meta_commands) + return E_INVALIDARG; + + *num_meta_commands = 0; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3D12Device9 *iface, diff --git a/tests/d3d12.c b/tests/d3d12.c index f770ce6d3..cc22a5bf6 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -39235,6 +39235,39 @@ static void test_multi_fence_event(void) ok(!refcount, "ID3D12Device has %u references left.\n", refcount); } +static void test_enumerate_meta_commands(void) +{ + ID3D12Device5 *device5; + unsigned int refcount; + ID3D12Device *device; + UINT count; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + if (FAILED(ID3D12Device_QueryInterface(device, &IID_ID3D12Device5, (void **)&device5))) + { + skip("ID3D12Device5 not available; skipping tests.\n"); + ID3D12Device_Release(device); + return; + } + + hr = ID3D12Device5_EnumerateMetaCommands(device5, NULL, NULL); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + + count = 0; + hr = ID3D12Device5_EnumerateMetaCommands(device5, &count, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + ID3D12Device5_Release(device5); + refcount = ID3D12Device_Release(device); + ok(!refcount, "ID3D12Device has %u references left.\n", refcount); +} + START_TEST(d3d12) { parse_args(argc, argv); @@ -39421,4 +39454,5 @@ START_TEST(d3d12) run_test(test_unused_interpolated_input); run_test(test_shader_cache); run_test(test_multi_fence_event); + run_test(test_enumerate_meta_commands); }