Commit fbfc8df4 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

dxgi: Add IDXGISwapChain4 stubs for D3D11.

Microsoft Flight Simulator (2020) requires IDXGISwapChain4.
parent 3c3bfbfd
...@@ -470,7 +470,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX ...@@ -470,7 +470,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX
TRACE("Created swapchain %p.\n", object); TRACE("Created swapchain %p.\n", object);
*swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain3_iface; *swapchain = (IDXGISwapChain1 *)&object->IDXGISwapChain4_iface;
return S_OK; return S_OK;
} }
......
...@@ -172,7 +172,7 @@ struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter(IDXGIAdapter *iface); ...@@ -172,7 +172,7 @@ struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter(IDXGIAdapter *iface);
/* IDXGISwapChain */ /* IDXGISwapChain */
struct d3d11_swapchain struct d3d11_swapchain
{ {
IDXGISwapChain3 IDXGISwapChain3_iface; IDXGISwapChain4 IDXGISwapChain4_iface;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store; struct wined3d_private_store private_store;
struct wined3d_swapchain *wined3d_swapchain; struct wined3d_swapchain *wined3d_swapchain;
......
...@@ -180,14 +180,14 @@ static HWND d3d11_swapchain_get_hwnd(struct d3d11_swapchain *swapchain) ...@@ -180,14 +180,14 @@ static HWND d3d11_swapchain_get_hwnd(struct d3d11_swapchain *swapchain)
return wined3d_desc.device_window; return wined3d_desc.device_window;
} }
static inline struct d3d11_swapchain *d3d11_swapchain_from_IDXGISwapChain3(IDXGISwapChain3 *iface) static inline struct d3d11_swapchain *d3d11_swapchain_from_IDXGISwapChain4(IDXGISwapChain4 *iface)
{ {
return CONTAINING_RECORD(iface, struct d3d11_swapchain, IDXGISwapChain3_iface); return CONTAINING_RECORD(iface, struct d3d11_swapchain, IDXGISwapChain4_iface);
} }
/* IUnknown methods */ /* IUnknown methods */
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_QueryInterface(IDXGISwapChain3 *iface, REFIID riid, void **object) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_QueryInterface(IDXGISwapChain4 *iface, REFIID riid, void **object)
{ {
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
...@@ -197,7 +197,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_QueryInterface(IDXGISwapChain3 ...@@ -197,7 +197,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_QueryInterface(IDXGISwapChain3
|| IsEqualGUID(riid, &IID_IDXGISwapChain) || IsEqualGUID(riid, &IID_IDXGISwapChain)
|| IsEqualGUID(riid, &IID_IDXGISwapChain1) || IsEqualGUID(riid, &IID_IDXGISwapChain1)
|| IsEqualGUID(riid, &IID_IDXGISwapChain2) || IsEqualGUID(riid, &IID_IDXGISwapChain2)
|| IsEqualGUID(riid, &IID_IDXGISwapChain3)) || IsEqualGUID(riid, &IID_IDXGISwapChain3)
|| IsEqualGUID(riid, &IID_IDXGISwapChain4))
{ {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*object = iface; *object = iface;
...@@ -210,9 +211,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_QueryInterface(IDXGISwapChain3 ...@@ -210,9 +211,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_QueryInterface(IDXGISwapChain3
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static ULONG STDMETHODCALLTYPE d3d11_swapchain_AddRef(IDXGISwapChain3 *iface) static ULONG STDMETHODCALLTYPE d3d11_swapchain_AddRef(IDXGISwapChain4 *iface)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
ULONG refcount = InterlockedIncrement(&swapchain->refcount); ULONG refcount = InterlockedIncrement(&swapchain->refcount);
TRACE("%p increasing refcount to %lu.\n", swapchain, refcount); TRACE("%p increasing refcount to %lu.\n", swapchain, refcount);
...@@ -223,9 +224,9 @@ static ULONG STDMETHODCALLTYPE d3d11_swapchain_AddRef(IDXGISwapChain3 *iface) ...@@ -223,9 +224,9 @@ static ULONG STDMETHODCALLTYPE d3d11_swapchain_AddRef(IDXGISwapChain3 *iface)
return refcount; return refcount;
} }
static ULONG STDMETHODCALLTYPE d3d11_swapchain_Release(IDXGISwapChain3 *iface) static ULONG STDMETHODCALLTYPE d3d11_swapchain_Release(IDXGISwapChain4 *iface)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
ULONG refcount = InterlockedDecrement(&swapchain->refcount); ULONG refcount = InterlockedDecrement(&swapchain->refcount);
TRACE("%p decreasing refcount to %lu.\n", swapchain, refcount); TRACE("%p decreasing refcount to %lu.\n", swapchain, refcount);
...@@ -248,39 +249,39 @@ static ULONG STDMETHODCALLTYPE d3d11_swapchain_Release(IDXGISwapChain3 *iface) ...@@ -248,39 +249,39 @@ static ULONG STDMETHODCALLTYPE d3d11_swapchain_Release(IDXGISwapChain3 *iface)
/* IDXGIObject methods */ /* IDXGIObject methods */
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetPrivateData(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetPrivateData(IDXGISwapChain4 *iface,
REFGUID guid, UINT data_size, const void *data) REFGUID guid, UINT data_size, const void *data)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); 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); return dxgi_set_private_data(&swapchain->private_store, guid, data_size, data);
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetPrivateDataInterface(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetPrivateDataInterface(IDXGISwapChain4 *iface,
REFGUID guid, const IUnknown *object) REFGUID guid, const IUnknown *object)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
return dxgi_set_private_data_interface(&swapchain->private_store, guid, object); return dxgi_set_private_data_interface(&swapchain->private_store, guid, object);
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetPrivateData(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetPrivateData(IDXGISwapChain4 *iface,
REFGUID guid, UINT *data_size, void *data) REFGUID guid, UINT *data_size, void *data)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); 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); return dxgi_get_private_data(&swapchain->private_store, guid, data_size, data);
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetParent(IDXGISwapChain3 *iface, REFIID riid, void **parent) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetParent(IDXGISwapChain4 *iface, REFIID riid, void **parent)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent); TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
...@@ -289,9 +290,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetParent(IDXGISwapChain3 *ifac ...@@ -289,9 +290,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetParent(IDXGISwapChain3 *ifac
/* IDXGIDeviceSubObject methods */ /* IDXGIDeviceSubObject methods */
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDevice(IDXGISwapChain3 *iface, REFIID riid, void **device) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDevice(IDXGISwapChain4 *iface, REFIID riid, void **device)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device); TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
...@@ -327,19 +328,19 @@ static HRESULT d3d11_swapchain_present(struct d3d11_swapchain *swapchain, ...@@ -327,19 +328,19 @@ static HRESULT d3d11_swapchain_present(struct d3d11_swapchain *swapchain,
return hr; return hr;
} }
static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_Present(IDXGISwapChain3 *iface, UINT sync_interval, UINT flags) static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_Present(IDXGISwapChain4 *iface, UINT sync_interval, UINT flags)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, sync_interval %u, flags %#x.\n", iface, sync_interval, flags); TRACE("iface %p, sync_interval %u, flags %#x.\n", iface, sync_interval, flags);
return d3d11_swapchain_present(swapchain, sync_interval, flags); return d3d11_swapchain_present(swapchain, sync_interval, flags);
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetBuffer(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetBuffer(IDXGISwapChain4 *iface,
UINT buffer_idx, REFIID riid, void **surface) UINT buffer_idx, REFIID riid, void **surface)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_texture *texture; struct wined3d_texture *texture;
IUnknown *parent; IUnknown *parent;
HRESULT hr; HRESULT hr;
...@@ -362,10 +363,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetBuffer(IDXGISwapChain3 *ifac ...@@ -362,10 +363,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetBuffer(IDXGISwapChain3 *ifac
return hr; return hr;
} }
static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreenState(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreenState(IDXGISwapChain4 *iface,
BOOL fullscreen, IDXGIOutput *target) BOOL fullscreen, IDXGIOutput *target)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_desc swapchain_desc; struct wined3d_swapchain_desc swapchain_desc;
struct wined3d_swapchain_state *state; struct wined3d_swapchain_state *state;
struct dxgi_output *dxgi_output; struct dxgi_output *dxgi_output;
...@@ -385,7 +386,7 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen ...@@ -385,7 +386,7 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen
{ {
IDXGIOutput_AddRef(target); 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 %#lx.\n", hr); WARN("Failed to get target output for swapchain, hr %#lx.\n", hr);
return hr; return hr;
...@@ -400,7 +401,7 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen ...@@ -400,7 +401,7 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen
{ {
WARN("Nested invocation of SetFullscreenState.\n"); WARN("Nested invocation of SetFullscreenState.\n");
IDXGIOutput_Release(target); IDXGIOutput_Release(target);
IDXGISwapChain3_GetFullscreenState(iface, &old_fs, NULL); IDXGISwapChain4_GetFullscreenState(iface, &old_fs, NULL);
return old_fs == fullscreen ? S_OK : DXGI_STATUS_MODE_CHANGE_IN_PROGRESS; return old_fs == fullscreen ? S_OK : DXGI_STATUS_MODE_CHANGE_IN_PROGRESS;
} }
...@@ -433,10 +434,10 @@ done: ...@@ -433,10 +434,10 @@ done:
return hr; return hr;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapChain4 *iface,
BOOL *fullscreen, IDXGIOutput **target) BOOL *fullscreen, IDXGIOutput **target)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_desc swapchain_desc; struct wined3d_swapchain_desc swapchain_desc;
HRESULT hr; HRESULT hr;
...@@ -456,7 +457,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapCha ...@@ -456,7 +457,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapCha
{ {
if (!swapchain_desc.windowed) if (!swapchain_desc.windowed)
{ {
if (!swapchain->target && FAILED(hr = IDXGISwapChain3_GetContainingOutput(iface, &swapchain->target))) if (!swapchain->target && FAILED(hr = IDXGISwapChain4_GetContainingOutput(iface, &swapchain->target)))
return hr; return hr;
*target = swapchain->target; *target = swapchain->target;
...@@ -471,9 +472,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapCha ...@@ -471,9 +472,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapCha
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc(IDXGISwapChain3 *iface, DXGI_SWAP_CHAIN_DESC *desc) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc(IDXGISwapChain4 *iface, DXGI_SWAP_CHAIN_DESC *desc)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_desc wined3d_desc; struct wined3d_swapchain_desc wined3d_desc;
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
...@@ -512,10 +513,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc(IDXGISwapChain3 *iface, ...@@ -512,10 +513,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc(IDXGISwapChain3 *iface,
static HRESULT d3d11_swapchain_create_d3d11_textures(struct d3d11_swapchain *swapchain, static HRESULT d3d11_swapchain_create_d3d11_textures(struct d3d11_swapchain *swapchain,
IWineDXGIDevice *device, struct wined3d_swapchain_desc *desc); IWineDXGIDevice *device, struct wined3d_swapchain_desc *desc);
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers(IDXGISwapChain4 *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags) UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_desc wined3d_desc; struct wined3d_swapchain_desc wined3d_desc;
struct wined3d_texture *texture; struct wined3d_texture *texture;
IUnknown *parent; IUnknown *parent;
...@@ -556,10 +557,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers(IDXGISwapChain3 * ...@@ -556,10 +557,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers(IDXGISwapChain3 *
return hr; return hr;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain4 *iface,
const DXGI_MODE_DESC *target_mode_desc) const DXGI_MODE_DESC *target_mode_desc)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_state *state; struct wined3d_swapchain_state *state;
TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc); TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc);
...@@ -569,9 +570,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain3 *i ...@@ -569,9 +570,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain3 *i
return dxgi_swapchain_resize_target(state, target_mode_desc); return dxgi_swapchain_resize_target(state, target_mode_desc);
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapChain3 *iface, IDXGIOutput **output) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapChain4 *iface, IDXGIOutput **output)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
HWND window; HWND window;
TRACE("iface %p, output %p.\n", iface, output); TRACE("iface %p, output %p.\n", iface, output);
...@@ -586,7 +587,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapCh ...@@ -586,7 +587,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapCh
return dxgi_get_output_from_window(swapchain->factory, window, output); return dxgi_get_output_from_window(swapchain->factory, window, output);
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFrameStatistics(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFrameStatistics(IDXGISwapChain4 *iface,
DXGI_FRAME_STATISTICS *stats) DXGI_FRAME_STATISTICS *stats)
{ {
FIXME("iface %p, stats %p stub!\n", iface, stats); FIXME("iface %p, stats %p stub!\n", iface, stats);
...@@ -594,10 +595,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFrameStatistics(IDXGISwapCha ...@@ -594,10 +595,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFrameStatistics(IDXGISwapCha
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapChain4 *iface,
UINT *last_present_count) UINT *last_present_count)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, last_present_count %p.\n", iface, last_present_count); TRACE("iface %p, last_present_count %p.\n", iface, last_present_count);
...@@ -608,9 +609,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapCh ...@@ -608,9 +609,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapCh
/* IDXGISwapChain1 methods */ /* IDXGISwapChain1 methods */
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc1(IDXGISwapChain3 *iface, DXGI_SWAP_CHAIN_DESC1 *desc) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc1(IDXGISwapChain4 *iface, DXGI_SWAP_CHAIN_DESC1 *desc)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_desc wined3d_desc; struct wined3d_swapchain_desc wined3d_desc;
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
...@@ -643,10 +644,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc1(IDXGISwapChain3 *iface ...@@ -643,10 +644,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc1(IDXGISwapChain3 *iface
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenDesc(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenDesc(IDXGISwapChain4 *iface,
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *desc) DXGI_SWAP_CHAIN_FULLSCREEN_DESC *desc)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
struct wined3d_swapchain_desc wined3d_desc; struct wined3d_swapchain_desc wined3d_desc;
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
...@@ -672,9 +673,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenDesc(IDXGISwapChai ...@@ -672,9 +673,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenDesc(IDXGISwapChai
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetHwnd(IDXGISwapChain3 *iface, HWND *hwnd) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetHwnd(IDXGISwapChain4 *iface, HWND *hwnd)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, hwnd %p.\n", iface, hwnd); TRACE("iface %p, hwnd %p.\n", iface, hwnd);
...@@ -688,7 +689,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetHwnd(IDXGISwapChain3 *iface, ...@@ -688,7 +689,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetHwnd(IDXGISwapChain3 *iface,
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetCoreWindow(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetCoreWindow(IDXGISwapChain4 *iface,
REFIID iid, void **core_window) REFIID iid, void **core_window)
{ {
FIXME("iface %p, iid %s, core_window %p stub!\n", iface, debugstr_guid(iid), core_window); FIXME("iface %p, iid %s, core_window %p stub!\n", iface, debugstr_guid(iid), core_window);
...@@ -699,10 +700,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetCoreWindow(IDXGISwapChain3 * ...@@ -699,10 +700,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetCoreWindow(IDXGISwapChain3 *
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_Present1(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_Present1(IDXGISwapChain4 *iface,
UINT sync_interval, UINT flags, const DXGI_PRESENT_PARAMETERS *present_parameters) UINT sync_interval, UINT flags, const DXGI_PRESENT_PARAMETERS *present_parameters)
{ {
struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain3(iface); struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
TRACE("iface %p, sync_interval %u, flags %#x, present_parameters %p.\n", TRACE("iface %p, sync_interval %u, flags %#x, present_parameters %p.\n",
iface, sync_interval, flags, present_parameters); iface, sync_interval, flags, present_parameters);
...@@ -713,14 +714,14 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_Present1(IDXGISwapChain3 *iface ...@@ -713,14 +714,14 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_Present1(IDXGISwapChain3 *iface
return d3d11_swapchain_present(swapchain, sync_interval, flags); return d3d11_swapchain_present(swapchain, sync_interval, flags);
} }
static BOOL STDMETHODCALLTYPE d3d11_swapchain_IsTemporaryMonoSupported(IDXGISwapChain3 *iface) static BOOL STDMETHODCALLTYPE d3d11_swapchain_IsTemporaryMonoSupported(IDXGISwapChain4 *iface)
{ {
FIXME("iface %p stub!\n", iface); FIXME("iface %p stub!\n", iface);
return FALSE; return FALSE;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRestrictToOutput(IDXGISwapChain3 *iface, IDXGIOutput **output) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRestrictToOutput(IDXGISwapChain4 *iface, IDXGIOutput **output)
{ {
FIXME("iface %p, output %p stub!\n", iface, output); FIXME("iface %p, output %p stub!\n", iface, output);
...@@ -734,28 +735,28 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRestrictToOutput(IDXGISwapCh ...@@ -734,28 +735,28 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRestrictToOutput(IDXGISwapCh
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetBackgroundColor(IDXGISwapChain3 *iface, const DXGI_RGBA *color) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetBackgroundColor(IDXGISwapChain4 *iface, const DXGI_RGBA *color)
{ {
FIXME("iface %p, color %p stub!\n", iface, color); FIXME("iface %p, color %p stub!\n", iface, color);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetBackgroundColor(IDXGISwapChain3 *iface, DXGI_RGBA *color) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetBackgroundColor(IDXGISwapChain4 *iface, DXGI_RGBA *color)
{ {
FIXME("iface %p, color %p stub!\n", iface, color); FIXME("iface %p, color %p stub!\n", iface, color);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetRotation(IDXGISwapChain3 *iface, DXGI_MODE_ROTATION rotation) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetRotation(IDXGISwapChain4 *iface, DXGI_MODE_ROTATION rotation)
{ {
FIXME("iface %p, rotation %#x stub!\n", iface, rotation); FIXME("iface %p, rotation %#x stub!\n", iface, rotation);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRotation(IDXGISwapChain3 *iface, DXGI_MODE_ROTATION *rotation) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRotation(IDXGISwapChain4 *iface, DXGI_MODE_ROTATION *rotation)
{ {
FIXME("iface %p, rotation %p stub!\n", iface, rotation); FIXME("iface %p, rotation %p stub!\n", iface, rotation);
...@@ -764,42 +765,42 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRotation(IDXGISwapChain3 *if ...@@ -764,42 +765,42 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetRotation(IDXGISwapChain3 *if
/* IDXGISwapChain2 methods */ /* IDXGISwapChain2 methods */
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetSourceSize(IDXGISwapChain3 *iface, UINT width, UINT height) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetSourceSize(IDXGISwapChain4 *iface, UINT width, UINT height)
{ {
FIXME("iface %p, width %u, height %u stub!\n", iface, width, height); FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetSourceSize(IDXGISwapChain3 *iface, UINT *width, UINT *height) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetSourceSize(IDXGISwapChain4 *iface, UINT *width, UINT *height)
{ {
FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetMaximumFrameLatency(IDXGISwapChain3 *iface, UINT max_latency) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetMaximumFrameLatency(IDXGISwapChain4 *iface, UINT max_latency)
{ {
FIXME("iface %p, max_latency %u stub!\n", iface, max_latency); FIXME("iface %p, max_latency %u stub!\n", iface, max_latency);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetMaximumFrameLatency(IDXGISwapChain3 *iface, UINT *max_latency) static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetMaximumFrameLatency(IDXGISwapChain4 *iface, UINT *max_latency)
{ {
FIXME("iface %p, max_latency %p stub!\n", iface, max_latency); FIXME("iface %p, max_latency %p stub!\n", iface, max_latency);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HANDLE STDMETHODCALLTYPE d3d11_swapchain_GetFrameLatencyWaitableObject(IDXGISwapChain3 *iface) static HANDLE STDMETHODCALLTYPE d3d11_swapchain_GetFrameLatencyWaitableObject(IDXGISwapChain4 *iface)
{ {
FIXME("iface %p stub!\n", iface); FIXME("iface %p stub!\n", iface);
return NULL; return NULL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetMatrixTransform(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetMatrixTransform(IDXGISwapChain4 *iface,
const DXGI_MATRIX_3X2_F *matrix) const DXGI_MATRIX_3X2_F *matrix)
{ {
FIXME("iface %p, matrix %p stub!\n", iface, matrix); FIXME("iface %p, matrix %p stub!\n", iface, matrix);
...@@ -807,7 +808,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetMatrixTransform(IDXGISwapCha ...@@ -807,7 +808,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetMatrixTransform(IDXGISwapCha
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetMatrixTransform(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetMatrixTransform(IDXGISwapChain4 *iface,
DXGI_MATRIX_3X2_F *matrix) DXGI_MATRIX_3X2_F *matrix)
{ {
FIXME("iface %p, matrix %p stub!\n", iface, matrix); FIXME("iface %p, matrix %p stub!\n", iface, matrix);
...@@ -817,14 +818,14 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetMatrixTransform(IDXGISwapCha ...@@ -817,14 +818,14 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetMatrixTransform(IDXGISwapCha
/* IDXGISwapChain3 methods */ /* IDXGISwapChain3 methods */
static UINT STDMETHODCALLTYPE d3d11_swapchain_GetCurrentBackBufferIndex(IDXGISwapChain3 *iface) static UINT STDMETHODCALLTYPE d3d11_swapchain_GetCurrentBackBufferIndex(IDXGISwapChain4 *iface)
{ {
FIXME("iface %p stub!\n", iface); FIXME("iface %p stub!\n", iface);
return 0; return 0;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_CheckColorSpaceSupport(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_CheckColorSpaceSupport(IDXGISwapChain4 *iface,
DXGI_COLOR_SPACE_TYPE colour_space, UINT *colour_space_support) DXGI_COLOR_SPACE_TYPE colour_space, UINT *colour_space_support)
{ {
FIXME("iface %p, colour_space %#x, colour_space_support %p stub!\n", FIXME("iface %p, colour_space %#x, colour_space_support %p stub!\n",
...@@ -833,7 +834,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_CheckColorSpaceSupport(IDXGISwa ...@@ -833,7 +834,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_CheckColorSpaceSupport(IDXGISwa
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetColorSpace1(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetColorSpace1(IDXGISwapChain4 *iface,
DXGI_COLOR_SPACE_TYPE colour_space) DXGI_COLOR_SPACE_TYPE colour_space)
{ {
FIXME("iface %p, colour_space %#x stub!\n", iface, colour_space); FIXME("iface %p, colour_space %#x stub!\n", iface, colour_space);
...@@ -841,7 +842,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetColorSpace1(IDXGISwapChain3 ...@@ -841,7 +842,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_SetColorSpace1(IDXGISwapChain3
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers1(IDXGISwapChain3 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers1(IDXGISwapChain4 *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags, UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags,
const UINT *node_mask, IUnknown * const *present_queue) const UINT *node_mask, IUnknown * const *present_queue)
{ {
...@@ -852,7 +853,17 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers1(IDXGISwapChain3 ...@@ -852,7 +853,17 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers1(IDXGISwapChain3
return E_NOTIMPL; return E_NOTIMPL;
} }
static const struct IDXGISwapChain3Vtbl d3d11_swapchain_vtbl = /* IDXGISwapChain4 methods */
static HRESULT STDMETHODCALLTYPE d3d11_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 d3d11_swapchain_vtbl =
{ {
/* IUnknown methods */ /* IUnknown methods */
d3d11_swapchain_QueryInterface, d3d11_swapchain_QueryInterface,
...@@ -901,6 +912,8 @@ static const struct IDXGISwapChain3Vtbl d3d11_swapchain_vtbl = ...@@ -901,6 +912,8 @@ static const struct IDXGISwapChain3Vtbl d3d11_swapchain_vtbl =
d3d11_swapchain_CheckColorSpaceSupport, d3d11_swapchain_CheckColorSpaceSupport,
d3d11_swapchain_SetColorSpace1, d3d11_swapchain_SetColorSpace1,
d3d11_swapchain_ResizeBuffers1, d3d11_swapchain_ResizeBuffers1,
/* IDXGISwapChain4 methods */
d3d11_swapchain_SetHDRMetaData,
}; };
static void STDMETHODCALLTYPE d3d11_swapchain_wined3d_object_released(void *parent) static void STDMETHODCALLTYPE d3d11_swapchain_wined3d_object_released(void *parent)
...@@ -993,7 +1006,7 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi ...@@ -993,7 +1006,7 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi
} }
IWineDXGIDevice_AddRef(swapchain->device = &device->IWineDXGIDevice_iface); IWineDXGIDevice_AddRef(swapchain->device = &device->IWineDXGIDevice_iface);
swapchain->IDXGISwapChain3_iface.lpVtbl = &d3d11_swapchain_vtbl; swapchain->IDXGISwapChain4_iface.lpVtbl = &d3d11_swapchain_vtbl;
swapchain->state_parent.ops = &d3d11_swapchain_state_parent_ops; swapchain->state_parent.ops = &d3d11_swapchain_state_parent_ops;
swapchain->refcount = 1; swapchain->refcount = 1;
wined3d_mutex_lock(); wined3d_mutex_lock();
...@@ -1027,7 +1040,7 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi ...@@ -1027,7 +1040,7 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi
{ {
desc->windowed = FALSE; desc->windowed = FALSE;
if (FAILED(hr = IDXGISwapChain3_GetContainingOutput(&swapchain->IDXGISwapChain3_iface, if (FAILED(hr = IDXGISwapChain4_GetContainingOutput(&swapchain->IDXGISwapChain4_iface,
&swapchain->target))) &swapchain->target)))
{ {
WARN("Failed to get target output for fullscreen swapchain, hr %#lx.\n", hr); WARN("Failed to get target output for fullscreen swapchain, hr %#lx.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment