wined3d: Pass a struct wined3d_output pointer to wined3d_swapchain_state_set_fullscreen().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2020-03-05 23:04:13 +08:00 committed by Alexandre Julliard
parent 54d0869b2e
commit 878211c36f
6 changed files with 11 additions and 13 deletions

View File

@ -164,7 +164,7 @@ static HRESULT dxgi_swapchain_set_fullscreen_state(struct wined3d_swapchain_stat
wined3d_mutex_lock();
hr = wined3d_swapchain_state_set_fullscreen(state, swapchain_desc,
adapter->factory->wined3d, adapter->ordinal, NULL);
adapter->factory->wined3d, dxgi_output->wined3d_output, NULL);
wined3d_mutex_unlock();
return hr;

View File

@ -5147,7 +5147,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
}
if (FAILED(hr = wined3d_swapchain_state_set_fullscreen(&swapchain->state,
swapchain_desc, device->wined3d, device->adapter->ordinal, mode)))
swapchain_desc, device->wined3d, &device->adapter->outputs[0], mode)))
return hr;
/* Switch from fullscreen to windowed. */

View File

@ -1604,13 +1604,13 @@ void wined3d_swapchain_state_restore_from_fullscreen(struct wined3d_swapchain_st
HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_state *state,
const struct wined3d_swapchain_desc *swapchain_desc, struct wined3d *wined3d,
unsigned int adapter_idx, const struct wined3d_display_mode *mode)
struct wined3d_output *output, const struct wined3d_display_mode *mode)
{
struct wined3d_display_mode actual_mode;
HRESULT hr;
TRACE("state %p, swapchain_desc %p, wined3d %p, adapter_idx %u, mode %p.\n",
state, swapchain_desc, wined3d, adapter_idx, mode);
TRACE("state %p, swapchain_desc %p, wined3d %p, output %p, mode %p.\n",
state, swapchain_desc, wined3d, output, mode);
if (state->desc.flags & WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH)
{
@ -1622,12 +1622,10 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
{
if (!swapchain_desc->windowed)
{
const struct wined3d_adapter *adapter = wined3d->adapters[adapter_idx];
actual_mode.width = swapchain_desc->backbuffer_width;
actual_mode.height = swapchain_desc->backbuffer_height;
actual_mode.refresh_rate = swapchain_desc->refresh_rate;
actual_mode.format_id = adapter_format_from_backbuffer_format(adapter,
actual_mode.format_id = adapter_format_from_backbuffer_format(output->adapter,
swapchain_desc->backbuffer_format);
actual_mode.scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
}
@ -1637,7 +1635,7 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
}
}
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, wined3d, adapter_idx, &actual_mode)))
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, wined3d, 0, &actual_mode)))
return hr;
}
else
@ -1645,7 +1643,7 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
if (mode)
WARN("WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH is not set, ignoring mode.\n");
if (FAILED(hr = wined3d_get_adapter_display_mode(wined3d, adapter_idx, &actual_mode, NULL)))
if (FAILED(hr = wined3d_get_adapter_display_mode(wined3d, 0, &actual_mode, NULL)))
{
ERR("Failed to get display mode, hr %#x.\n", hr);
return WINED3DERR_INVALIDCALL;

View File

@ -283,7 +283,7 @@
@ cdecl wined3d_swapchain_state_create(ptr ptr ptr long ptr)
@ cdecl wined3d_swapchain_state_destroy(ptr)
@ cdecl wined3d_swapchain_state_resize_target(ptr ptr long ptr)
@ cdecl wined3d_swapchain_state_set_fullscreen(ptr ptr ptr long ptr)
@ cdecl wined3d_swapchain_state_set_fullscreen(ptr ptr ptr ptr ptr)
@ cdecl wined3d_texture_add_dirty_region(ptr long ptr)
@ cdecl wined3d_texture_blt(ptr long ptr ptr long ptr long ptr long)

View File

@ -565,7 +565,7 @@ static LRESULT CALLBACK wined3d_hook_proc(int code, WPARAM wparam, LPARAM lparam
wined3d_swapchain_get_desc(swapchain, &swapchain_desc);
swapchain_desc.windowed = !swapchain_desc.windowed;
wined3d_swapchain_state_set_fullscreen(&swapchain->state, &swapchain_desc,
swapchain->device->wined3d, swapchain->device->adapter->ordinal, NULL);
swapchain->device->wined3d, &swapchain->device->adapter->outputs[0], NULL);
wined3d_wndproc_mutex_unlock();

View File

@ -2762,7 +2762,7 @@ HRESULT __cdecl wined3d_swapchain_state_resize_target(struct wined3d_swapchain_s
struct wined3d *wined3d, unsigned int adapter_idx, const struct wined3d_display_mode *mode);
HRESULT __cdecl wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_state *state,
const struct wined3d_swapchain_desc *desc, struct wined3d *wined3d,
unsigned int adapter_idx, const struct wined3d_display_mode *mode);
struct wined3d_output *output, const struct wined3d_display_mode *mode);
HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
UINT layer, const struct wined3d_box *dirty_region);