[PATCH 1/2] dxgi: Remove wined3d_swapchain dependency from d3d11_swapchain_ResizeTarget().
Henri Verbeet
hverbeet at gmail.com
Fri Jun 21 04:47:49 CDT 2019
On Fri, 21 Jun 2019 at 11:35, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain1 *iface,
> const DXGI_MODE_DESC *target_mode_desc)
> {
> - struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain1(iface);
> - struct wined3d_display_mode mode;
> + struct DXGI_SWAP_CHAIN_DESC swap_chain_desc;
>
> TRACE("iface %p, target_mode_desc %p.\n", iface, target_mode_desc);
>
> @@ -520,9 +574,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeTarget(IDXGISwapChain1 *i
> if (target_mode_desc->Scaling)
> FIXME("Ignoring scaling %#x.\n", target_mode_desc->Scaling);
>
> - wined3d_display_mode_from_dxgi(&mode, target_mode_desc);
> + d3d11_swapchain_GetDesc(iface, &swap_chain_desc);
>
> - return wined3d_swapchain_resize_target(swapchain->wined3d_swapchain, &mode);
> + return dxgi_resize_target(iface, &swap_chain_desc, target_mode_desc);
> }
This is the only user of wined3d_swapchain_resize_target(), so in
principle it could now be removed from wined3d. Whether that's a good
idea depends to some extent on what we're going to do with the other
swapchain functions. For example, wined3d_swapchain_set_fullscreen()
is also used by wined3d internally, and has some interactions with the
wined3d device, so in some regards it's a more interesting case. I.e.,
we wouldn't want to use one approach for
wined3d_swapchain_resize_target(), and then another for
wined3d_swapchain_set_fullscreen(), and perhaps a third for e.g. gamma
control.
More information about the wine-devel
mailing list