Commit 7d351e11 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

dxgi: Slightly simplify d3d11_swapchain_init().

parent b1568535
...@@ -474,7 +474,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX ...@@ -474,7 +474,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX
return E_OUTOFMEMORY; 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); WARN("Failed to initialise swapchain, hr %#x.\n", hr);
heap_free(object); heap_free(object);
...@@ -578,7 +578,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l ...@@ -578,7 +578,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
return E_OUTOFMEMORY; 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); WARN("Failed to initialize swapchain, hr %#x.\n", hr);
heap_free(swapchain); heap_free(swapchain);
......
...@@ -178,7 +178,7 @@ struct d3d11_swapchain ...@@ -178,7 +178,7 @@ struct d3d11_swapchain
}; };
HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_device *device, 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, 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, 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 = ...@@ -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, 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; HRESULT hr;
/* /* A reference to the implicit swapchain is held by the wined3d device. In
* A reference to the implicit swapchain is held by the wined3d device. * order to avoid circular references we do not keep a reference to the
* In order to avoid circular references we do not keep a reference * device in the implicit swapchain. */
* to the device in the implicit swapchain. if (!(desc->flags & WINED3D_SWAPCHAIN_IMPLICIT))
*/
if (!implicit)
{ {
if (desc->backbuffer_format == WINED3DFMT_UNKNOWN) if (desc->backbuffer_format == WINED3DFMT_UNKNOWN)
return E_INVALIDARG; return E_INVALIDARG;
......
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