Commit cdcc2ade authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Pass a wined3d_device_context to wined3d_device_get_viewports().

parent 850a90e1
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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,
......
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