Commit 0bf68935 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Issue queries through wined3d_device_context_ops.

parent 35cd4115
......@@ -2213,16 +2213,18 @@ static void wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
InterlockedIncrement(&query->counter_retrieved);
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
static void wined3d_cs_issue_query(struct wined3d_device_context *context,
struct wined3d_query *query, unsigned int flags)
{
struct wined3d_cs *cs = wined3d_cs_from_context(context);
struct wined3d_cs_query_issue *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_QUERY_ISSUE;
op->query = query;
op->flags = flags;
wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT);
cs->queries_flushed = FALSE;
}
......@@ -2796,6 +2798,7 @@ static const struct wined3d_device_context_ops wined3d_cs_st_ops =
wined3d_cs_st_push_constants,
wined3d_cs_map,
wined3d_cs_unmap,
wined3d_cs_issue_query,
};
static BOOL wined3d_cs_queue_is_empty(const struct wined3d_cs *cs, const struct wined3d_cs_queue *queue)
......@@ -2919,6 +2922,7 @@ static const struct wined3d_device_context_ops wined3d_cs_mt_ops =
wined3d_cs_mt_push_constants,
wined3d_cs_map,
wined3d_cs_unmap,
wined3d_cs_issue_query,
};
static void poll_queries(struct wined3d_cs *cs)
......
......@@ -507,7 +507,7 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags)
if (flags & WINED3DISSUE_END)
++query->counter_main;
wined3d_cs_emit_query_issue(query->device->cs, query, flags);
query->device->cs->c.ops->issue_query(&query->device->cs->c, query, flags);
if (flags & WINED3DISSUE_BEGIN)
query->state = QUERY_BUILDING;
......
......@@ -4692,6 +4692,7 @@ struct wined3d_device_context_ops
unsigned int flags);
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);
};
struct wined3d_device_context
......@@ -4737,7 +4738,6 @@ 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;
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx,
const struct wined3d_vec4 *plane) 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