From e00ce29a5e78eb529467001fd3ea2f64ec472aa7 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 16 Mar 2021 00:42:21 -0500 Subject: [PATCH] wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_scissor_rects(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/cs.c | 7 ++++--- dlls/wined3d/device.c | 6 +++--- dlls/wined3d/wined3d_private.h | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index d7a413057c9..d8635bba8d7 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1173,17 +1173,18 @@ static void wined3d_cs_exec_set_scissor_rects(struct wined3d_cs *cs, const void device_invalidate_state(cs->c.device, STATE_SCISSORRECT); } -void wined3d_cs_emit_set_scissor_rects(struct wined3d_cs *cs, unsigned int rect_count, const RECT *rects) +void wined3d_device_context_emit_set_scissor_rects(struct wined3d_device_context *context, + unsigned int rect_count, const RECT *rects) { struct wined3d_cs_set_scissor_rects *op; - op = wined3d_device_context_require_space(&cs->c, FIELD_OFFSET(struct wined3d_cs_set_scissor_rects, rects[rect_count]), + op = wined3d_device_context_require_space(context, FIELD_OFFSET(struct wined3d_cs_set_scissor_rects, rects[rect_count]), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECTS; memcpy(op->rects, rects, rect_count * sizeof(*rects)); op->rect_count = rect_count; - wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); } static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6e9afb8468d..0ba5215c076 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1858,7 +1858,7 @@ void CDECL wined3d_device_set_scissor_rects(struct wined3d_device *device, unsig memset(state->scissor_rects, 0, sizeof(state->scissor_rects)); state->scissor_rect_count = rect_count; - wined3d_cs_emit_set_scissor_rects(device->cs, rect_count, rects); + wined3d_device_context_emit_set_scissor_rects(&device->cs->c, rect_count, rects); } void CDECL wined3d_device_get_scissor_rects(const struct wined3d_device *device, unsigned int *rect_count, RECT *rects) @@ -1977,7 +1977,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3 wined3d_cs_emit_set_material(device->cs, &state->material); wined3d_device_context_emit_set_viewports(context, state->viewport_count, state->viewports); - wined3d_cs_emit_set_scissor_rects(device->cs, state->scissor_rect_count, state->scissor_rects); + wined3d_device_context_emit_set_scissor_rects(context, state->scissor_rect_count, state->scissor_rects); for (i = 0; i < LIGHTMAP_SIZE; ++i) { @@ -5211,7 +5211,7 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device SetRect(&state->scissor_rects[0], 0, 0, view->width, view->height); state->scissor_rect_count = 1; - wined3d_cs_emit_set_scissor_rects(device->cs, 1, state->scissor_rects); + wined3d_device_context_emit_set_scissor_rects(&device->cs->c, 1, state->scissor_rects); } prev = state->fb.render_targets[view_idx]; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 524b6ae7ce3..4ad0c05d34a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4776,7 +4776,6 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type UINT sampler_idx, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value) DECLSPEC_HIDDEN; -void wined3d_cs_emit_set_scissor_rects(struct wined3d_cs *cs, unsigned int rect_count, const RECT *rects) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, @@ -4824,6 +4823,8 @@ void wined3d_device_context_emit_set_depth_stencil_state(struct wined3d_device_c struct wined3d_depth_stencil_state *state, unsigned int stencil_ref) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_rasterizer_state(struct wined3d_device_context *context, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_set_scissor_rects(struct wined3d_device_context *context, + unsigned int rect_count, const RECT *rects) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_shader(struct wined3d_device_context *context, enum wined3d_shader_type type, struct wined3d_shader *shader) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_viewports(struct wined3d_device_context *context, unsigned int viewport_count,