[PATCH v2 1/6] dxgi: Remove wined3d_swapchain dependency from d3d11_swapchain_ResizeTarget().

Józef Kucia joseph.kucia at gmail.com
Tue Jun 25 06:52:29 CDT 2019


The commit summary line is quite inaccurate. One of the following
summary lines seem to be much better:
* "wined3d: Move wined3d_swapchain_resize_target() to dxgi.",
* "dxgi: Move wined3d_swapchain_resize_targe() from wined3d.".

On Mon, Jun 24, 2019 at 4:23 PM Conor McCarthy
<cmccarthy at codeweavers.com> wrote:
>  HRESULT dxgi_output_create(struct dxgi_adapter *adapter, struct dxgi_output **output) DECLSPEC_HIDDEN;
> +HRESULT dxgi_output_set_display_mode(IDXGIOutput *iface, DXGI_MODE_DESC *target_mode_desc) DECLSPEC_HIDDEN;
> +HRESULT dxgi_output_get_display_mode(IDXGIOutput *iface, DXGI_MODE_DESC *mode_desc) DECLSPEC_HIDDEN;

Please sort by the function name. We  tend to keep declarations sorted
in d3d code.

> +HRESULT dxgi_output_set_display_mode(IDXGIOutput *iface, DXGI_MODE_DESC *target_mode_desc)

I'm not sure if "target_mode_desc" is necessarily better than
"mode_desc" or simply "mode".

> +{
> +    struct wined3d_display_mode wined3d_mode;
> +    struct dxgi_adapter *adapter;
> +    struct dxgi_output *target;
> +    struct wined3d *wined3d;
> +    HRESULT hr;
> +
> +    target = impl_from_IDXGIOutput4((IDXGIOutput4 *)iface);

The cast from IDXGIOutput to IDXGIOutput4 isn't very nice. I am in
favor of introducing unsafe_impl_from_IDXGIOuput(). See
unsafe_impl_from_IDXGIAdapter().

> diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
> index 4f01d9c..b060a30 100644
> --- a/dlls/dxgi/swapchain.c
> +++ b/dlls/dxgi/swapchain.c
> @@ -501,11 +501,65 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_ResizeBuffers(IDXGISwapChain1 *
>      return hr;
>  }
>
> +static HRESULT dxgi_resize_target(IDXGISwapChain1 *iface,
> +        const DXGI_SWAP_CHAIN_DESC *desc, const DXGI_MODE_DESC *mode)

Personally, I'd name it "dxgi_swapchain_resize_target". It could also
probably be moved to the top of the file, next to similar helpers
(e.g. after dxgi_get_output_from_window()). Placing it between D3D11
swapchain methods isn't the best choice.



More information about the wine-devel mailing list