dxgi: Implement IDXGISwapChain4 stub.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-07-16 17:26:53 +02:00 committed by Alexandre Julliard
parent d806203850
commit 5079d31e3a
1 changed files with 85 additions and 72 deletions

View File

@ -1032,7 +1032,7 @@ static HRESULT hresult_from_vk_result(VkResult vr)
struct d3d12_swapchain
{
IDXGISwapChain3 IDXGISwapChain3_iface;
IDXGISwapChain4 IDXGISwapChain4_iface;
LONG refcount;
struct wined3d_private_store private_store;
@ -1820,14 +1820,14 @@ static HRESULT d3d12_swapchain_recreate_vulkan_swapchain(struct d3d12_swapchain
return hr;
}
static inline struct d3d12_swapchain *d3d12_swapchain_from_IDXGISwapChain3(IDXGISwapChain3 *iface)
static inline struct d3d12_swapchain *d3d12_swapchain_from_IDXGISwapChain4(IDXGISwapChain4 *iface)
{
return CONTAINING_RECORD(iface, struct d3d12_swapchain, IDXGISwapChain3_iface);
return CONTAINING_RECORD(iface, struct d3d12_swapchain, IDXGISwapChain4_iface);
}
/* IUnknown methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_QueryInterface(IDXGISwapChain3 *iface, REFIID iid, void **object)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_QueryInterface(IDXGISwapChain4 *iface, REFIID iid, void **object)
{
TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object);
@ -1837,7 +1837,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_QueryInterface(IDXGISwapChain3
|| IsEqualGUID(iid, &IID_IDXGISwapChain)
|| IsEqualGUID(iid, &IID_IDXGISwapChain1)
|| IsEqualGUID(iid, &IID_IDXGISwapChain2)
|| IsEqualGUID(iid, &IID_IDXGISwapChain3))
|| IsEqualGUID(iid, &IID_IDXGISwapChain3)
|| IsEqualGUID(iid, &IID_IDXGISwapChain4))
{
IUnknown_AddRef(iface);
*object = iface;
@ -1850,9 +1851,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_QueryInterface(IDXGISwapChain3
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE d3d12_swapchain_AddRef(IDXGISwapChain3 *iface)
static ULONG STDMETHODCALLTYPE d3d12_swapchain_AddRef(IDXGISwapChain4 *iface)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
ULONG refcount = InterlockedIncrement(&swapchain->refcount);
TRACE("%p increasing refcount to %u.\n", swapchain, refcount);
@ -1904,9 +1905,9 @@ static void d3d12_swapchain_destroy(struct d3d12_swapchain *swapchain)
wined3d_swapchain_state_destroy(swapchain->state);
}
static ULONG STDMETHODCALLTYPE d3d12_swapchain_Release(IDXGISwapChain3 *iface)
static ULONG STDMETHODCALLTYPE d3d12_swapchain_Release(IDXGISwapChain4 *iface)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
ULONG refcount = InterlockedDecrement(&swapchain->refcount);
TRACE("%p decreasing refcount to %u.\n", swapchain, refcount);
@ -1922,39 +1923,39 @@ static ULONG STDMETHODCALLTYPE d3d12_swapchain_Release(IDXGISwapChain3 *iface)
/* IDXGIObject methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateData(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateData(IDXGISwapChain4 *iface,
REFGUID guid, UINT data_size, const void *data)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return dxgi_set_private_data(&swapchain->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateDataInterface(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetPrivateDataInterface(IDXGISwapChain4 *iface,
REFGUID guid, const IUnknown *object)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
return dxgi_set_private_data_interface(&swapchain->private_store, guid, object);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetPrivateData(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetPrivateData(IDXGISwapChain4 *iface,
REFGUID guid, UINT *data_size, void *data)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return dxgi_get_private_data(&swapchain->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetParent(IDXGISwapChain3 *iface, REFIID iid, void **parent)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetParent(IDXGISwapChain4 *iface, REFIID iid, void **parent)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent);
@ -1963,9 +1964,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetParent(IDXGISwapChain3 *ifac
/* IDXGIDeviceSubObject methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDevice(IDXGISwapChain3 *iface, REFIID iid, void **device)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDevice(IDXGISwapChain4 *iface, REFIID iid, void **device)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
@ -2183,19 +2184,19 @@ static HRESULT d3d12_swapchain_present(struct d3d12_swapchain *swapchain,
return hresult_from_vk_result(vr);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present(IDXGISwapChain3 *iface, UINT sync_interval, UINT flags)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present(IDXGISwapChain4 *iface, UINT sync_interval, UINT flags)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, sync_interval %u, flags %#x.\n", iface, sync_interval, flags);
return d3d12_swapchain_present(swapchain, sync_interval, flags);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBuffer(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBuffer(IDXGISwapChain4 *iface,
UINT buffer_idx, REFIID iid, void **surface)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, buffer_idx %u, iid %s, surface %p.\n",
iface, buffer_idx, debugstr_guid(iid), surface);
@ -2210,10 +2211,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBuffer(IDXGISwapChain3 *ifac
return ID3D12Resource_QueryInterface(swapchain->buffers[buffer_idx], iid, surface);
}
static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreenState(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreenState(IDXGISwapChain4 *iface,
BOOL fullscreen, IDXGIOutput *target)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc = &swapchain->fullscreen_desc;
const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc = &swapchain->desc;
struct wined3d_swapchain_desc wined3d_desc;
@ -2232,7 +2233,7 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen
{
IDXGIOutput_AddRef(target);
}
else if (FAILED(hr = IDXGISwapChain3_GetContainingOutput(iface, &target)))
else if (FAILED(hr = IDXGISwapChain4_GetContainingOutput(iface, &target)))
{
WARN("Failed to get target output for swapchain, hr %#x.\n", hr);
return hr;
@ -2267,10 +2268,10 @@ fail:
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapChain4 *iface,
BOOL *fullscreen, IDXGIOutput **target)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, fullscreen %p, target %p.\n", iface, fullscreen, target);
@ -2283,9 +2284,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapCha
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc(IDXGISwapChain3 *iface, DXGI_SWAP_CHAIN_DESC *desc)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc(IDXGISwapChain4 *iface, DXGI_SWAP_CHAIN_DESC *desc)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc = &swapchain->fullscreen_desc;
const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc = &swapchain->desc;
@ -2372,10 +2373,10 @@ static HRESULT d3d12_swapchain_resize_buffers(struct d3d12_swapchain *swapchain,
return d3d12_swapchain_recreate_vulkan_swapchain(swapchain);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain4 *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x.\n",
iface, buffer_count, width, height, debug_dxgi_format(format), flags);
@ -2383,20 +2384,20 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain3 *
return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height, format, flags);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeTarget(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeTarget(IDXGISwapChain4 *iface,
const DXGI_MODE_DESC *target_mode_desc)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc);
return dxgi_swapchain_resize_target(swapchain->state, target_mode_desc);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapChain4 *iface,
IDXGIOutput **output)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
IUnknown *device_parent;
IDXGIFactory *factory;
IDXGIAdapter *adapter;
@ -2431,7 +2432,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapCh
return hr;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapChain4 *iface,
DXGI_FRAME_STATISTICS *stats)
{
FIXME("iface %p, stats %p stub!\n", iface, stats);
@ -2439,7 +2440,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapCha
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapChain4 *iface,
UINT *last_present_count)
{
FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count);
@ -2449,9 +2450,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapCh
/* IDXGISwapChain1 methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc1(IDXGISwapChain3 *iface, DXGI_SWAP_CHAIN_DESC1 *desc)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc1(IDXGISwapChain4 *iface, DXGI_SWAP_CHAIN_DESC1 *desc)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
@ -2465,10 +2466,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc1(IDXGISwapChain3 *iface
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenDesc(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenDesc(IDXGISwapChain4 *iface,
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *desc)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
@ -2482,9 +2483,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenDesc(IDXGISwapChai
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetHwnd(IDXGISwapChain3 *iface, HWND *hwnd)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetHwnd(IDXGISwapChain4 *iface, HWND *hwnd)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, hwnd %p.\n", iface, hwnd);
@ -2498,7 +2499,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetHwnd(IDXGISwapChain3 *iface,
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetCoreWindow(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetCoreWindow(IDXGISwapChain4 *iface,
REFIID iid, void **core_window)
{
FIXME("iface %p, iid %s, core_window %p stub!\n", iface, debugstr_guid(iid), core_window);
@ -2509,10 +2510,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetCoreWindow(IDXGISwapChain3 *
return DXGI_ERROR_INVALID_CALL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present1(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present1(IDXGISwapChain4 *iface,
UINT sync_interval, UINT flags, const DXGI_PRESENT_PARAMETERS *present_parameters)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, sync_interval %u, flags %#x, present_parameters %p.\n",
iface, sync_interval, flags, present_parameters);
@ -2523,14 +2524,14 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_Present1(IDXGISwapChain3 *iface
return d3d12_swapchain_present(swapchain, sync_interval, flags);
}
static BOOL STDMETHODCALLTYPE d3d12_swapchain_IsTemporaryMonoSupported(IDXGISwapChain3 *iface)
static BOOL STDMETHODCALLTYPE d3d12_swapchain_IsTemporaryMonoSupported(IDXGISwapChain4 *iface)
{
FIXME("iface %p stub!\n", iface);
return FALSE;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRestrictToOutput(IDXGISwapChain3 *iface, IDXGIOutput **output)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRestrictToOutput(IDXGISwapChain4 *iface, IDXGIOutput **output)
{
FIXME("iface %p, output %p stub!\n", iface, output);
@ -2544,28 +2545,28 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRestrictToOutput(IDXGISwapCh
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetBackgroundColor(IDXGISwapChain3 *iface, const DXGI_RGBA *color)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetBackgroundColor(IDXGISwapChain4 *iface, const DXGI_RGBA *color)
{
FIXME("iface %p, color %p stub!\n", iface, color);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBackgroundColor(IDXGISwapChain3 *iface, DXGI_RGBA *color)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBackgroundColor(IDXGISwapChain4 *iface, DXGI_RGBA *color)
{
FIXME("iface %p, color %p stub!\n", iface, color);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetRotation(IDXGISwapChain3 *iface, DXGI_MODE_ROTATION rotation)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetRotation(IDXGISwapChain4 *iface, DXGI_MODE_ROTATION rotation)
{
FIXME("iface %p, rotation %#x stub!\n", iface, rotation);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRotation(IDXGISwapChain3 *iface, DXGI_MODE_ROTATION *rotation)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRotation(IDXGISwapChain4 *iface, DXGI_MODE_ROTATION *rotation)
{
FIXME("iface %p, rotation %p stub!\n", iface, rotation);
@ -2574,23 +2575,23 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetRotation(IDXGISwapChain3 *if
/* IDXGISwapChain2 methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetSourceSize(IDXGISwapChain3 *iface, UINT width, UINT height)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetSourceSize(IDXGISwapChain4 *iface, UINT width, UINT height)
{
FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetSourceSize(IDXGISwapChain3 *iface, UINT *width, UINT *height)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetSourceSize(IDXGISwapChain4 *iface, UINT *width, UINT *height)
{
FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMaximumFrameLatency(IDXGISwapChain3 *iface, UINT max_latency)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMaximumFrameLatency(IDXGISwapChain4 *iface, UINT max_latency)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, max_latency %u.\n", iface, max_latency);
@ -2610,9 +2611,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMaximumFrameLatency(IDXGISwa
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMaximumFrameLatency(IDXGISwapChain3 *iface, UINT *max_latency)
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMaximumFrameLatency(IDXGISwapChain4 *iface, UINT *max_latency)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, max_latency %p.\n", iface, max_latency);
@ -2626,16 +2627,16 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMaximumFrameLatency(IDXGISwa
return S_OK;
}
static HANDLE STDMETHODCALLTYPE d3d12_swapchain_GetFrameLatencyWaitableObject(IDXGISwapChain3 *iface)
static HANDLE STDMETHODCALLTYPE d3d12_swapchain_GetFrameLatencyWaitableObject(IDXGISwapChain4 *iface)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p.\n", iface);
return swapchain->frame_latency_event;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMatrixTransform(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMatrixTransform(IDXGISwapChain4 *iface,
const DXGI_MATRIX_3X2_F *matrix)
{
FIXME("iface %p, matrix %p stub!\n", iface, matrix);
@ -2643,7 +2644,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetMatrixTransform(IDXGISwapCha
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMatrixTransform(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMatrixTransform(IDXGISwapChain4 *iface,
DXGI_MATRIX_3X2_F *matrix)
{
FIXME("iface %p, matrix %p stub!\n", iface, matrix);
@ -2653,9 +2654,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetMatrixTransform(IDXGISwapCha
/* IDXGISwapChain3 methods */
static UINT STDMETHODCALLTYPE d3d12_swapchain_GetCurrentBackBufferIndex(IDXGISwapChain3 *iface)
static UINT STDMETHODCALLTYPE d3d12_swapchain_GetCurrentBackBufferIndex(IDXGISwapChain4 *iface)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p.\n", iface);
@ -2664,7 +2665,7 @@ static UINT STDMETHODCALLTYPE d3d12_swapchain_GetCurrentBackBufferIndex(IDXGISwa
return swapchain->current_buffer_index;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_CheckColorSpaceSupport(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_CheckColorSpaceSupport(IDXGISwapChain4 *iface,
DXGI_COLOR_SPACE_TYPE colour_space, UINT *colour_space_support)
{
UINT support_flags = 0;
@ -2682,7 +2683,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_CheckColorSpaceSupport(IDXGISwa
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetColorSpace1(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetColorSpace1(IDXGISwapChain4 *iface,
DXGI_COLOR_SPACE_TYPE colour_space)
{
FIXME("iface %p, colour_space %#x semi-stub!\n", iface, colour_space);
@ -2696,11 +2697,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetColorSpace1(IDXGISwapChain3
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers1(IDXGISwapChain3 *iface,
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers1(IDXGISwapChain4 *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags,
const UINT *node_mask, IUnknown * const *present_queue)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
size_t i, count;
TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x, "
@ -2722,7 +2723,17 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers1(IDXGISwapChain3
return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height, format, flags);
}
static const struct IDXGISwapChain3Vtbl d3d12_swapchain_vtbl =
/* IDXGISwapChain4 methods */
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_SetHDRMetaData(IDXGISwapChain4 *iface,
DXGI_HDR_METADATA_TYPE type, UINT size, void *metadata)
{
FIXME("iface %p, type %#x, size %#x, metadata %p stub!\n", iface, type, size, metadata);
return E_NOTIMPL;
}
static const struct IDXGISwapChain4Vtbl d3d12_swapchain_vtbl =
{
/* IUnknown methods */
d3d12_swapchain_QueryInterface,
@ -2771,6 +2782,8 @@ static const struct IDXGISwapChain3Vtbl d3d12_swapchain_vtbl =
d3d12_swapchain_CheckColorSpaceSupport,
d3d12_swapchain_SetColorSpace1,
d3d12_swapchain_ResizeBuffers1,
/* IDXGISwapChain4 methods */
d3d12_swapchain_SetHDRMetaData,
};
static BOOL load_vkd3d_functions(void *vkd3d_handle)
@ -2918,7 +2931,7 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI
return E_ACCESSDENIED;
}
swapchain->IDXGISwapChain3_iface.lpVtbl = &d3d12_swapchain_vtbl;
swapchain->IDXGISwapChain4_iface.lpVtbl = &d3d12_swapchain_vtbl;
swapchain->refcount = 1;
swapchain->window = window;
@ -3123,7 +3136,7 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
TRACE("Created swapchain %p.\n", object);
*swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain3_iface;
*swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain4_iface;
return S_OK;
}