Commit 878211c3 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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

parent 54d0869b
...@@ -164,7 +164,7 @@ static HRESULT dxgi_swapchain_set_fullscreen_state(struct wined3d_swapchain_stat ...@@ -164,7 +164,7 @@ static HRESULT dxgi_swapchain_set_fullscreen_state(struct wined3d_swapchain_stat
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_swapchain_state_set_fullscreen(state, swapchain_desc, 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(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -5147,7 +5147,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, ...@@ -5147,7 +5147,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
} }
} }
if (FAILED(hr = wined3d_swapchain_state_set_fullscreen(&swapchain->state, 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; return hr;
/* Switch from fullscreen to windowed. */ /* Switch from fullscreen to windowed. */
......
...@@ -1604,13 +1604,13 @@ void wined3d_swapchain_state_restore_from_fullscreen(struct wined3d_swapchain_st ...@@ -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, HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_state *state,
const struct wined3d_swapchain_desc *swapchain_desc, struct wined3d *wined3d, 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; struct wined3d_display_mode actual_mode;
HRESULT hr; HRESULT hr;
TRACE("state %p, swapchain_desc %p, wined3d %p, adapter_idx %u, mode %p.\n", TRACE("state %p, swapchain_desc %p, wined3d %p, output %p, mode %p.\n",
state, swapchain_desc, wined3d, adapter_idx, mode); state, swapchain_desc, wined3d, output, mode);
if (state->desc.flags & WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH) if (state->desc.flags & WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH)
{ {
...@@ -1622,12 +1622,10 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st ...@@ -1622,12 +1622,10 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
{ {
if (!swapchain_desc->windowed) if (!swapchain_desc->windowed)
{ {
const struct wined3d_adapter *adapter = wined3d->adapters[adapter_idx];
actual_mode.width = swapchain_desc->backbuffer_width; actual_mode.width = swapchain_desc->backbuffer_width;
actual_mode.height = swapchain_desc->backbuffer_height; actual_mode.height = swapchain_desc->backbuffer_height;
actual_mode.refresh_rate = swapchain_desc->refresh_rate; 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); swapchain_desc->backbuffer_format);
actual_mode.scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN; actual_mode.scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
} }
...@@ -1637,7 +1635,7 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st ...@@ -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; return hr;
} }
else else
...@@ -1645,7 +1643,7 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st ...@@ -1645,7 +1643,7 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
if (mode) if (mode)
WARN("WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH is not set, ignoring mode.\n"); 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); ERR("Failed to get display mode, hr %#x.\n", hr);
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
......
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
@ cdecl wined3d_swapchain_state_create(ptr ptr ptr long ptr) @ cdecl wined3d_swapchain_state_create(ptr ptr ptr long ptr)
@ cdecl wined3d_swapchain_state_destroy(ptr) @ cdecl wined3d_swapchain_state_destroy(ptr)
@ cdecl wined3d_swapchain_state_resize_target(ptr ptr long 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_add_dirty_region(ptr long ptr)
@ cdecl wined3d_texture_blt(ptr long ptr ptr long ptr long ptr long) @ cdecl wined3d_texture_blt(ptr long ptr ptr long ptr long ptr long)
......
...@@ -565,7 +565,7 @@ static LRESULT CALLBACK wined3d_hook_proc(int code, WPARAM wparam, LPARAM lparam ...@@ -565,7 +565,7 @@ static LRESULT CALLBACK wined3d_hook_proc(int code, WPARAM wparam, LPARAM lparam
wined3d_swapchain_get_desc(swapchain, &swapchain_desc); wined3d_swapchain_get_desc(swapchain, &swapchain_desc);
swapchain_desc.windowed = !swapchain_desc.windowed; swapchain_desc.windowed = !swapchain_desc.windowed;
wined3d_swapchain_state_set_fullscreen(&swapchain->state, &swapchain_desc, 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(); wined3d_wndproc_mutex_unlock();
......
...@@ -2762,7 +2762,7 @@ HRESULT __cdecl wined3d_swapchain_state_resize_target(struct wined3d_swapchain_s ...@@ -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); 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, HRESULT __cdecl wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_state *state,
const struct wined3d_swapchain_desc *desc, struct wined3d *wined3d, 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, HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
UINT layer, const struct wined3d_box *dirty_region); UINT layer, const struct wined3d_box *dirty_region);
......
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