Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
That's what it returns for software device on Windows, regardless of input format, while rejecting some.
dlls/dxva2/main.c | 18 +++++++++++++++++- dlls/dxva2/tests/Makefile.in | 2 +- dlls/dxva2/tests/dxva2.c | 23 ++++++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 22a35c4fbb3..6ebc4f00186 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -195,7 +195,23 @@ static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTa IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, UINT *count, D3DFORMAT **formats) { - FIXME("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats); + TRACE("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats); + + if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice)) + { + /* FIXME: filter some input formats */ + + if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats)))) + return E_OUTOFMEMORY; + + *count = 2; + (*formats)[0] = D3DFMT_X8R8G8B8; + (*formats)[1] = D3DFMT_A8R8G8B8; + + return S_OK; + } + else + FIXME("Unsupported device %s.\n", debugstr_guid(deviceguid));
return E_NOTIMPL; } diff --git a/dlls/dxva2/tests/Makefile.in b/dlls/dxva2/tests/Makefile.in index c86c5ab42fc..ccd03940a24 100644 --- a/dlls/dxva2/tests/Makefile.in +++ b/dlls/dxva2/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = dxva2.dll -IMPORTS = dxva2 user32 d3d9 +IMPORTS = dxva2 user32 d3d9 ole32
C_SRCS = \ dxva2.c diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c index 58b0231420d..f5b28ed3f8d 100644 --- a/dlls/dxva2/tests/dxva2.c +++ b/dlls/dxva2/tests/dxva2.c @@ -82,13 +82,16 @@ static void test_device_manager(void) IDirectXVideoProcessorService *processor_service; IDirectXVideoAccelerationService *accel_service; IDirect3DDevice9 *device, *device2, *device3; + IDirectXVideoProcessorService *proc_service; IDirect3DDeviceManager9 *manager; IDirect3DSurface9 *surfaces[2]; + DXVA2_VideoDesc video_desc; int refcount, refcount2; HANDLE handle, handle1; + D3DFORMAT *formats; + UINT token, count; IDirect3D9 *d3d; HWND window; - UINT token; HRESULT hr; RECT rect;
@@ -297,6 +300,24 @@ static void test_device_manager(void)
IDirectXVideoAccelerationService_Release(accel_service);
+ /* RT formats. */ + hr = DXVA2CreateVideoService(device, &IID_IDirectXVideoProcessorService, (void **)&proc_service); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + memset(&video_desc, 0, sizeof(video_desc)); + video_desc.SampleWidth = 64; + video_desc.SampleHeight = 64; + video_desc.Format = D3DFMT_A8R8G8B8; + + count = 0; + hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service, &DXVA2_VideoProcSoftwareDevice, + &video_desc, &count, &formats); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count, "Unexpected format count %u.\n", count); + CoTaskMemFree(formats); + + IDirectXVideoProcessorService_Release(proc_service); + hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);