Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 7 ++++--- dlls/d3d8/device.c | 2 +- dlls/d3d9/device.c | 2 +- dlls/ddraw/device.c | 2 +- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 29b5b11aebd..a85201a66de 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2233,7 +2233,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetState(ID3D11DeviceCon static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetViewports(ID3D11DeviceContext1 *iface, UINT *viewport_count, D3D11_VIEWPORT *viewports) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_viewport wined3d_vp[WINED3D_MAX_VIEWPORTS]; unsigned int actual_count = ARRAY_SIZE(wined3d_vp), i;
@@ -2243,7 +2243,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetViewports(ID3D11Devic return;
wined3d_mutex_lock(); - wined3d_device_get_viewports(device->wined3d_device, &actual_count, viewports ? wined3d_vp : NULL); + wined3d_device_context_get_viewports(context->wined3d_context, &actual_count, viewports ? wined3d_vp : NULL); wined3d_mutex_unlock();
if (!viewports) @@ -5526,7 +5526,8 @@ static void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device1 *iface, return;
wined3d_mutex_lock(); - wined3d_device_get_viewports(device->wined3d_device, &actual_count, viewports ? wined3d_vp : NULL); + wined3d_device_context_get_viewports(device->immediate_context.wined3d_context, + &actual_count, viewports ? wined3d_vp : NULL); wined3d_mutex_unlock();
if (!viewports) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index b07c20f71a0..7e6f407df58 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -561,7 +561,7 @@ static void device_reset_viewport_state(struct d3d8_device *device) struct wined3d_viewport vp; RECT rect;
- wined3d_device_get_viewports(device->wined3d_device, NULL, &vp); + wined3d_device_context_get_viewports(device->immediate_context, NULL, &vp); wined3d_stateblock_set_viewport(device->state, &vp); wined3d_device_get_scissor_rects(device->wined3d_device, NULL, &rect); wined3d_stateblock_set_scissor_rect(device->state, &rect); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 25d98b4395a..71826cfe81d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -587,7 +587,7 @@ static void device_reset_viewport_state(struct d3d9_device *device) struct wined3d_viewport vp; RECT rect;
- wined3d_device_get_viewports(device->wined3d_device, NULL, &vp); + wined3d_device_context_get_viewports(device->immediate_context, NULL, &vp); wined3d_stateblock_set_viewport(device->state, &vp); wined3d_device_get_scissor_rects(device->wined3d_device, NULL, &rect); wined3d_stateblock_set_scissor_rect(device->state, &rect); diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 52d20fc5a62..bf7ee1f22a0 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -6972,7 +6972,7 @@ static void ddraw_reset_viewport_state(struct ddraw *ddraw) struct wined3d_viewport vp; RECT rect;
- wined3d_device_get_viewports(ddraw->wined3d_device, NULL, &vp); + wined3d_device_context_get_viewports(ddraw->immediate_context, NULL, &vp); wined3d_stateblock_set_viewport(ddraw->state, &vp); wined3d_device_get_scissor_rects(ddraw->wined3d_device, NULL, &rect); wined3d_stateblock_set_scissor_rect(ddraw->state, &rect); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 452c3b35414..39b44831e25 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1560,13 +1560,13 @@ void CDECL wined3d_device_set_viewports(struct wined3d_device *device, unsigned wined3d_device_context_set_viewports(&device->cs->c, viewport_count, viewports); }
-void CDECL wined3d_device_get_viewports(const struct wined3d_device *device, unsigned int *viewport_count, - struct wined3d_viewport *viewports) +void CDECL wined3d_device_context_get_viewports(const struct wined3d_device_context *context, + unsigned int *viewport_count, struct wined3d_viewport *viewports) { - const struct wined3d_state *state = device->cs->c.state; + const struct wined3d_state *state = context->state; unsigned int count;
- TRACE("device %p, viewport_count %p, viewports %p.\n", device, viewport_count, viewports); + TRACE("context %p, viewport_count %p, viewports %p.\n", context, viewport_count, viewports);
count = viewport_count ? min(*viewport_count, state->viewport_count) : 1; if (count && viewports) @@ -3536,7 +3536,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO TRACE("%.8e %.8e %.8e %.8e\n", world_mat._41, world_mat._42, world_mat._43, world_mat._44);
/* Get the viewport */ - wined3d_device_get_viewports(device, NULL, &vp); + wined3d_device_context_get_viewports(&device->cs->c, NULL, &vp); TRACE("viewport x %.8e, y %.8e, width %.8e, height %.8e, min_z %.8e, max_z %.8e.\n", vp.x, vp.y, vp.width, vp.height, vp.min_z, vp.max_z);
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 2af21d5a31c..44cef466435 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -96,7 +96,6 @@ @ cdecl wined3d_device_get_unordered_access_view(ptr long) @ cdecl wined3d_device_get_vertex_declaration(ptr) @ cdecl wined3d_device_get_vertex_shader(ptr) -@ cdecl wined3d_device_get_viewports(ptr ptr ptr) @ cdecl wined3d_device_get_vs_resource_view(ptr long) @ cdecl wined3d_device_get_vs_sampler(ptr long) @ cdecl wined3d_device_get_wined3d(ptr) @@ -172,6 +171,7 @@ @ cdecl wined3d_device_context_get_depth_stencil_state(ptr ptr) @ cdecl wined3d_device_context_get_rasterizer_state(ptr) @ cdecl wined3d_device_context_get_shader(ptr long) +@ cdecl wined3d_device_context_get_viewports(ptr ptr ptr) @ cdecl wined3d_device_context_issue_query(ptr ptr long) @ cdecl wined3d_device_context_map(ptr ptr long ptr ptr long) @ cdecl wined3d_device_context_resolve_sub_resource(ptr ptr long ptr long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 6923b8ce9cb..cff06bbfc6b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2435,8 +2435,6 @@ struct wined3d_unordered_access_view * __cdecl wined3d_device_get_unordered_acce const struct wined3d_device *device, unsigned int idx); struct wined3d_vertex_declaration * __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wined3d_device *device); -void __cdecl wined3d_device_get_viewports(const struct wined3d_device *device, unsigned int *viewport_count, - struct wined3d_viewport *viewports); struct wined3d_shader_resource_view * __cdecl wined3d_device_get_vs_resource_view(const struct wined3d_device *device, UINT idx); struct wined3d_sampler * __cdecl wined3d_device_get_vs_sampler(const struct wined3d_device *device, UINT idx); @@ -2570,6 +2568,8 @@ struct wined3d_rasterizer_state * __cdecl wined3d_device_context_get_rasterizer_ struct wined3d_device_context *context); struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct wined3d_device_context *context, enum wined3d_shader_type type); +void __cdecl wined3d_device_context_get_viewports(const struct wined3d_device_context *context, + unsigned int *viewport_count, struct wined3d_viewport *viewports); void __cdecl wined3d_device_context_issue_query(struct wined3d_device_context *context, struct wined3d_query *query, unsigned int flags); HRESULT __cdecl wined3d_device_context_map(struct wined3d_device_context *context,