Commit 58b482c9 authored by Conor McCarthy's avatar Conor McCarthy Committed by Alexandre Julliard

dxgi: Implement IDXGISwapChain3::ResizeBuffers1().

Used by Hitman 2. Multiple nodes and command queues are not supported. Signed-off-by: 's avatarConor McCarthy <cmccarthy@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0425b6ad
......@@ -2311,17 +2311,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetDesc(IDXGISwapChain3 *iface,
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain3 *iface,
static HRESULT d3d12_swapchain_resize_buffers(struct d3d12_swapchain *swapchain,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
DXGI_SWAP_CHAIN_DESC1 *desc, new_desc;
unsigned int i;
ULONG refcount;
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);
if (flags)
FIXME("Ignoring flags %#x.\n", flags);
......@@ -2373,6 +2369,17 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain3 *
return d3d12_swapchain_recreate_vulkan_swapchain(swapchain);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers(IDXGISwapChain3 *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
{
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(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);
return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height, format, flags);
}
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeTarget(IDXGISwapChain3 *iface,
const DXGI_MODE_DESC *target_mode_desc)
{
......@@ -2642,11 +2649,26 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_ResizeBuffers1(IDXGISwapChain3
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags,
const UINT *node_mask, IUnknown * const *present_queue)
{
FIXME("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x, "
"node_mask %p, present_queue %p stub!\n",
struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain3(iface);
size_t i, count;
TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x, "
"node_mask %p, present_queue %p.\n",
iface, buffer_count, width, height, debug_dxgi_format(format), flags, node_mask, present_queue);
return E_NOTIMPL;
if (!node_mask || !present_queue)
return DXGI_ERROR_INVALID_CALL;
count = buffer_count ? buffer_count : swapchain->desc.BufferCount;
for (i = 0; i < count; ++i)
{
if (node_mask[i] > 1 || !present_queue[i])
return DXGI_ERROR_INVALID_CALL;
if ((ID3D12CommandQueue*)present_queue[i] != swapchain->command_queue)
FIXME("Ignoring present queue %p.\n", present_queue[i]);
}
return d3d12_swapchain_resize_buffers(swapchain, buffer_count, width, height, format, flags);
}
static const struct IDXGISwapChain3Vtbl d3d12_swapchain_vtbl =
......
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