wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_viewports().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-03-16 00:42:18 -05:00 committed by Alexandre Julliard
parent b18a48eb70
commit 911ed1caf1
3 changed files with 9 additions and 8 deletions

View File

@ -1147,18 +1147,18 @@ static void wined3d_cs_exec_set_viewports(struct wined3d_cs *cs, const void *dat
device_invalidate_state(cs->c.device, STATE_VIEWPORT);
}
void wined3d_cs_emit_set_viewports(struct wined3d_cs *cs, unsigned int viewport_count,
void wined3d_device_context_emit_set_viewports(struct wined3d_device_context *context, unsigned int viewport_count,
const struct wined3d_viewport *viewports)
{
struct wined3d_cs_set_viewports *op;
op = wined3d_device_context_require_space(&cs->c, FIELD_OFFSET(struct wined3d_cs_set_viewports, viewports[viewport_count]),
WINED3D_CS_QUEUE_DEFAULT);
op = wined3d_device_context_require_space(context,
FIELD_OFFSET(struct wined3d_cs_set_viewports,viewports[viewport_count]), WINED3D_CS_QUEUE_DEFAULT);
op->opcode = WINED3D_CS_OP_SET_VIEWPORTS;
memcpy(op->viewports, viewports, viewport_count * sizeof(*viewports));
op->viewport_count = viewport_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_scissor_rects(struct wined3d_cs *cs, const void *data)

View File

@ -1698,7 +1698,7 @@ void CDECL wined3d_device_set_viewports(struct wined3d_device *device, unsigned
memset(state->viewports, 0, sizeof(state->viewports));
state->viewport_count = viewport_count;
wined3d_cs_emit_set_viewports(device->cs, viewport_count, viewports);
wined3d_device_context_emit_set_viewports(&device->cs->c, viewport_count, viewports);
}
void CDECL wined3d_device_get_viewports(const struct wined3d_device *device, unsigned int *viewport_count,
@ -1983,7 +1983,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3
wined3d_cs_emit_set_material(device->cs, &state->material);
wined3d_cs_emit_set_viewports(device->cs, state->viewport_count, state->viewports);
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);
for (i = 0; i < LIGHTMAP_SIZE; ++i)
@ -5191,7 +5191,7 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
state->viewports[0].min_z = 0.0f;
state->viewports[0].max_z = 1.0f;
state->viewport_count = 1;
wined3d_cs_emit_set_viewports(device->cs, 1, state->viewports);
wined3d_device_context_emit_set_viewports(&device->cs->c, 1, state->viewports);
SetRect(&state->scissor_rects[0], 0, 0, view->width, view->height);
state->scissor_rect_count = 1;

View File

@ -4793,7 +4793,6 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
unsigned int initial_count) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewports(struct wined3d_cs *cs, unsigned int viewport_count, const struct wined3d_viewport *viewports) DECLSPEC_HIDDEN;
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
@ -4827,6 +4826,8 @@ void wined3d_device_context_emit_set_rasterizer_state(struct wined3d_device_cont
struct wined3d_rasterizer_state *rasterizer_state) 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,
const struct wined3d_viewport *viewports) DECLSPEC_HIDDEN;
static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource)
{