dxgi: Slightly simplify d3d11_swapchain_init().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b15685355c
commit
7d351e1168
|
@ -474,7 +474,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if (FAILED(hr = d3d11_swapchain_init(object, device, &wined3d_desc, FALSE)))
|
||||
if (FAILED(hr = d3d11_swapchain_init(object, device, &wined3d_desc)))
|
||||
{
|
||||
WARN("Failed to initialise swapchain, hr %#x.\n", hr);
|
||||
heap_free(object);
|
||||
|
@ -578,7 +578,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if (FAILED(hr = d3d11_swapchain_init(swapchain, device, &swapchain_desc, TRUE)))
|
||||
if (FAILED(hr = d3d11_swapchain_init(swapchain, device, &swapchain_desc)))
|
||||
{
|
||||
WARN("Failed to initialize swapchain, hr %#x.\n", hr);
|
||||
heap_free(swapchain);
|
||||
|
|
|
@ -178,7 +178,7 @@ struct d3d11_swapchain
|
|||
};
|
||||
|
||||
HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_device *device,
|
||||
struct wined3d_swapchain_desc *desc, BOOL implicit) DECLSPEC_HIDDEN;
|
||||
struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *queue, HWND window,
|
||||
const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc,
|
||||
|
|
|
@ -779,16 +779,14 @@ static const struct wined3d_parent_ops d3d11_swapchain_wined3d_parent_ops =
|
|||
};
|
||||
|
||||
HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_device *device,
|
||||
struct wined3d_swapchain_desc *desc, BOOL implicit)
|
||||
struct wined3d_swapchain_desc *desc)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
/*
|
||||
* A reference to the implicit swapchain is held by the wined3d device.
|
||||
* In order to avoid circular references we do not keep a reference
|
||||
* to the device in the implicit swapchain.
|
||||
*/
|
||||
if (!implicit)
|
||||
/* A reference to the implicit swapchain is held by the wined3d device. In
|
||||
* order to avoid circular references we do not keep a reference to the
|
||||
* device in the implicit swapchain. */
|
||||
if (!(desc->flags & WINED3D_SWAPCHAIN_IMPLICIT))
|
||||
{
|
||||
if (desc->backbuffer_format == WINED3DFMT_UNKNOWN)
|
||||
return E_INVALIDARG;
|
||||
|
|
Loading…
Reference in New Issue