Commit eba2523a authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

dxgi: Read back the swapchain size assigned by wined3d.

parent 28461117
......@@ -873,6 +873,7 @@ static HRESULT d3d11_swapchain_create_d3d11_textures(struct d3d11_swapchain *swa
HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_device *device,
struct wined3d_swapchain_desc *desc)
{
struct wined3d_swapchain_state *state;
BOOL fullscreen;
HRESULT hr;
......@@ -907,6 +908,9 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi
goto cleanup;
}
state = wined3d_swapchain_get_state(swapchain->wined3d_swapchain);
wined3d_swapchain_state_get_size(state, &desc->backbuffer_width, &desc->backbuffer_height);
if (FAILED(hr = d3d11_swapchain_create_d3d11_textures(swapchain, &device->IWineDXGIDevice_iface, desc)))
{
ERR("Failed to create d3d11 textures, hr %#lx.\n", hr);
......@@ -916,10 +920,7 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi
swapchain->target = NULL;
if (fullscreen)
{
struct wined3d_swapchain_state *state;
desc->windowed = FALSE;
state = wined3d_swapchain_get_state(swapchain->wined3d_swapchain);
if (FAILED(hr = IDXGISwapChain1_GetContainingOutput(&swapchain->IDXGISwapChain1_iface,
&swapchain->target)))
......@@ -3130,6 +3131,8 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI
return hr;
}
wined3d_swapchain_state_get_size(swapchain->state, &swapchain->desc.Width, &swapchain->desc.Height);
if (fullscreen)
{
wined3d_desc.windowed = FALSE;
......
......@@ -2427,6 +2427,15 @@ BOOL CDECL wined3d_swapchain_state_is_windowed(const struct wined3d_swapchain_st
return state->desc.windowed;
}
void CDECL wined3d_swapchain_state_get_size(const struct wined3d_swapchain_state *state,
unsigned int *width, unsigned int *height)
{
TRACE("state %p.\n", state);
*width = state->desc.backbuffer_width;
*height = state->desc.backbuffer_height;
}
void CDECL wined3d_swapchain_state_destroy(struct wined3d_swapchain_state *state)
{
wined3d_swapchain_state_cleanup(state);
......
......@@ -292,6 +292,7 @@
@ cdecl wined3d_swapchain_state_create(ptr ptr ptr ptr ptr)
@ cdecl wined3d_swapchain_state_destroy(ptr)
@ cdecl wined3d_swapchain_state_get_size(ptr ptr ptr)
@ cdecl wined3d_swapchain_state_is_windowed(ptr)
@ cdecl wined3d_swapchain_state_resize_target(ptr ptr)
@ cdecl wined3d_swapchain_state_set_fullscreen(ptr ptr ptr)
......
......@@ -2854,6 +2854,8 @@ HRESULT __cdecl wined3d_swapchain_state_create(const struct wined3d_swapchain_de
HWND window, struct wined3d *wined3d, struct wined3d_swapchain_state_parent *state_parent,
struct wined3d_swapchain_state **state);
void __cdecl wined3d_swapchain_state_destroy(struct wined3d_swapchain_state *state);
void __cdecl wined3d_swapchain_state_get_size(const struct wined3d_swapchain_state *state,
unsigned int *width, unsigned int *height);
BOOL __cdecl wined3d_swapchain_state_is_windowed(const struct wined3d_swapchain_state *state);
HRESULT __cdecl wined3d_swapchain_state_resize_target(struct wined3d_swapchain_state *state,
const struct wined3d_display_mode *mode);
......
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