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

wined3d: Flush through wined3d_device_context_ops.

parent e205b691
......@@ -480,6 +480,11 @@ static inline void wined3d_device_context_finish(struct wined3d_device_context *
context->ops->finish(context, queue_id);
}
static struct wined3d_cs *wined3d_cs_from_context(struct wined3d_device_context *context)
{
return CONTAINING_RECORD(context, struct wined3d_cs, c);
}
static const char *debug_cs_op(enum wined3d_cs_op op)
{
switch (op)
......@@ -1110,14 +1115,15 @@ static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data)
context_release(context);
}
void wined3d_cs_emit_flush(struct wined3d_cs *cs)
static void wined3d_cs_flush(struct wined3d_device_context *context)
{
struct wined3d_cs *cs = wined3d_cs_from_context(context);
struct wined3d_cs_flush *op;
op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
op->opcode = WINED3D_CS_OP_FLUSH;
wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT);
cs->queries_flushed = TRUE;
}
......@@ -2073,11 +2079,6 @@ wined3d_cs_push_constant_info[] =
{FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
};
static struct wined3d_cs *wined3d_cs_from_context(struct wined3d_device_context *context)
{
return CONTAINING_RECORD(context, struct wined3d_cs, c);
}
static void wined3d_cs_st_push_constants(struct wined3d_device_context *context, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants)
{
......@@ -2799,6 +2800,7 @@ static const struct wined3d_device_context_ops wined3d_cs_st_ops =
wined3d_cs_map,
wined3d_cs_unmap,
wined3d_cs_issue_query,
wined3d_cs_flush,
};
static BOOL wined3d_cs_queue_is_empty(const struct wined3d_cs *cs, const struct wined3d_cs_queue *queue)
......@@ -2923,6 +2925,7 @@ static const struct wined3d_device_context_ops wined3d_cs_mt_ops =
wined3d_cs_map,
wined3d_cs_unmap,
wined3d_cs_issue_query,
wined3d_cs_flush,
};
static void poll_queries(struct wined3d_cs *cs)
......
......@@ -5625,7 +5625,7 @@ void CDECL wined3d_device_flush(struct wined3d_device *device)
{
TRACE("device %p.\n", device);
wined3d_cs_emit_flush(device->cs);
device->cs->c.ops->flush(&device->cs->c);
}
static void update_swapchain_flags(struct wined3d_texture *texture)
......
......@@ -476,7 +476,7 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query,
|| (query->buffer_object && !wined3d_query_buffer_is_valid(query)))
{
if (flags & WINED3DGETDATA_FLUSH && !query->device->cs->queries_flushed)
wined3d_cs_emit_flush(query->device->cs);
query->device->cs->c.ops->flush(&query->device->cs->c);
return S_FALSE;
}
if (query->buffer_object)
......
......@@ -4693,6 +4693,7 @@ struct wined3d_device_context_ops
HRESULT (*unmap)(struct wined3d_device_context *context, struct wined3d_resource *resource,
unsigned int sub_resource_idx);
void (*issue_query)(struct wined3d_device_context *context, struct wined3d_query *query, unsigned int flags);
void (*flush)(struct wined3d_device_context *context);
};
struct wined3d_device_context
......@@ -4734,7 +4735,6 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
void wined3d_device_context_emit_clear_uav_uint(struct wined3d_device_context *context,
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) DECLSPEC_HIDDEN;
void wined3d_cs_emit_flush(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect,
const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, DWORD flags) DECLSPEC_HIDDEN;
......
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