gallivm/st/lvp: add flags arg to get_query_result_resource api.
Currently this just has wait, but in order to get the right answer for vulkan partial, lavapipe/llvmpipe need to pass a partial flag through here in the future. This just changes the API so that's possible. v2: use an enum (zmike) Acked-by: Ilia Mirkin <imirkin@alum.mit.edu> Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15009>
This commit is contained in:
parent
b995a8eba4
commit
127bcbed18
|
@ -500,7 +500,7 @@ dd_dump_get_query_result_resource(struct call_get_query_result_resource *info, F
|
|||
{
|
||||
fprintf(f, "%s:\n", __func__ + 8);
|
||||
DUMP_M(query_type, info, query_type);
|
||||
DUMP_M(uint, info, wait);
|
||||
DUMP_M(query_flags, info, flags);
|
||||
DUMP_M(query_value_type, info, result_type);
|
||||
DUMP_M(int, info, index);
|
||||
DUMP_M(resource, info, resource);
|
||||
|
@ -1445,7 +1445,7 @@ dd_context_generate_mipmap(struct pipe_context *_pipe,
|
|||
static void
|
||||
dd_context_get_query_result_resource(struct pipe_context *_pipe,
|
||||
struct pipe_query *query,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -1458,7 +1458,7 @@ dd_context_get_query_result_resource(struct pipe_context *_pipe,
|
|||
|
||||
record->call.type = CALL_GET_QUERY_RESULT_RESOURCE;
|
||||
record->call.info.get_query_result_resource.query = query;
|
||||
record->call.info.get_query_result_resource.wait = wait;
|
||||
record->call.info.get_query_result_resource.flags = flags;
|
||||
record->call.info.get_query_result_resource.result_type = result_type;
|
||||
record->call.info.get_query_result_resource.index = index;
|
||||
record->call.info.get_query_result_resource.resource = NULL;
|
||||
|
@ -1470,7 +1470,7 @@ dd_context_get_query_result_resource(struct pipe_context *_pipe,
|
|||
record->call.info.get_query_result_resource.query_type = dquery->type;
|
||||
|
||||
dd_before_draw(dctx, record);
|
||||
pipe->get_query_result_resource(pipe, dquery->query, wait,
|
||||
pipe->get_query_result_resource(pipe, dquery->query, flags,
|
||||
result_type, index, resource, offset);
|
||||
dd_after_draw(dctx, record);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ struct call_draw_info {
|
|||
struct call_get_query_result_resource {
|
||||
struct pipe_query *query;
|
||||
enum pipe_query_type query_type;
|
||||
bool wait;
|
||||
enum pipe_query_flags flags;
|
||||
enum pipe_query_value_type result_type;
|
||||
int index;
|
||||
struct pipe_resource *resource;
|
||||
|
|
|
@ -303,7 +303,7 @@ static void noop_render_condition( struct pipe_context *pipe,
|
|||
|
||||
static void noop_get_query_result_resource(struct pipe_context *pipe,
|
||||
struct pipe_query *q,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
|
|
@ -324,7 +324,7 @@ trace_context_get_query_result(struct pipe_context *_pipe,
|
|||
static void
|
||||
trace_context_get_query_result_resource(struct pipe_context *_pipe,
|
||||
struct pipe_query *_query,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -339,7 +339,7 @@ trace_context_get_query_result_resource(struct pipe_context *_pipe,
|
|||
|
||||
trace_dump_arg(ptr, pipe);
|
||||
trace_dump_arg(ptr, query);
|
||||
trace_dump_arg(bool, wait);
|
||||
trace_dump_arg(query_flags, flags);
|
||||
trace_dump_arg(uint, result_type);
|
||||
trace_dump_arg(uint, index);
|
||||
trace_dump_arg(ptr, resource);
|
||||
|
@ -350,7 +350,7 @@ trace_context_get_query_result_resource(struct pipe_context *_pipe,
|
|||
|
||||
trace_dump_call_end();
|
||||
|
||||
pipe->get_query_result_resource(pipe, query, wait, result_type, index, resource, offset);
|
||||
pipe->get_query_result_resource(pipe, query, flags, result_type, index, resource, offset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,6 +53,15 @@ trace_dump_query_type(unsigned value)
|
|||
trace_dump_enum(util_str_query_type(value, false));
|
||||
}
|
||||
|
||||
static inline void
|
||||
trace_dump_query_flags(unsigned value)
|
||||
{
|
||||
if (!trace_dumping_enabled_locked())
|
||||
return;
|
||||
|
||||
trace_dump_enum(util_str_query_type(value, false));
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* TR_DUMP_DEFINES_H_ */
|
||||
|
|
|
@ -102,6 +102,9 @@ util_dump_query_type(FILE *stream, unsigned value);
|
|||
void
|
||||
util_dump_query_value_type(FILE *stream, unsigned value);
|
||||
|
||||
void
|
||||
util_dump_query_flags(FILE *stream, unsigned value);
|
||||
|
||||
void
|
||||
util_dump_transfer_usage(FILE *stream, unsigned value);
|
||||
|
||||
|
|
|
@ -509,6 +509,12 @@ util_dump_query_value_type(FILE *stream, unsigned value)
|
|||
fprintf(stream, "%s", util_str_query_value_type(value, false));
|
||||
}
|
||||
|
||||
void
|
||||
util_dump_query_flags(FILE *stream, unsigned value)
|
||||
{
|
||||
fprintf(stream, "%s", util_str_query_value_type(value, false));
|
||||
}
|
||||
|
||||
|
||||
static const char * const
|
||||
util_transfer_usage_names[] = {
|
||||
|
|
|
@ -894,7 +894,7 @@ tc_get_query_result(struct pipe_context *_pipe,
|
|||
|
||||
struct tc_query_result_resource {
|
||||
struct tc_call_base base;
|
||||
bool wait;
|
||||
enum pipe_query_flags flags:8;
|
||||
enum pipe_query_value_type result_type:8;
|
||||
int8_t index; /* it can be -1 */
|
||||
unsigned offset;
|
||||
|
@ -907,7 +907,7 @@ tc_call_get_query_result_resource(struct pipe_context *pipe, void *call, uint64_
|
|||
{
|
||||
struct tc_query_result_resource *p = to_call(call, tc_query_result_resource);
|
||||
|
||||
pipe->get_query_result_resource(pipe, p->query, p->wait, p->result_type,
|
||||
pipe->get_query_result_resource(pipe, p->query, p->flags, p->result_type,
|
||||
p->index, p->resource, p->offset);
|
||||
tc_drop_resource_reference(p->resource);
|
||||
return call_size(tc_query_result_resource);
|
||||
|
@ -915,7 +915,8 @@ tc_call_get_query_result_resource(struct pipe_context *pipe, void *call, uint64_
|
|||
|
||||
static void
|
||||
tc_get_query_result_resource(struct pipe_context *_pipe,
|
||||
struct pipe_query *query, bool wait,
|
||||
struct pipe_query *query,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type, int index,
|
||||
struct pipe_resource *resource, unsigned offset)
|
||||
{
|
||||
|
@ -927,7 +928,7 @@ tc_get_query_result_resource(struct pipe_context *_pipe,
|
|||
tc_add_call(tc, TC_CALL_get_query_result_resource,
|
||||
tc_query_result_resource);
|
||||
p->query = query;
|
||||
p->wait = wait;
|
||||
p->flags = flags;
|
||||
p->result_type = result_type;
|
||||
p->index = index;
|
||||
tc_set_resource_reference(&p->resource, resource);
|
||||
|
|
|
@ -699,7 +699,7 @@ crocus_get_query_result(struct pipe_context *ctx,
|
|||
static void
|
||||
crocus_get_query_result_resource(struct pipe_context *ctx,
|
||||
struct pipe_query *query,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *p_res,
|
||||
|
@ -759,7 +759,7 @@ crocus_get_query_result_resource(struct pipe_context *ctx,
|
|||
}
|
||||
|
||||
#if GFX_VERx10 >= 75
|
||||
bool predicated = !wait && !q->stalled;
|
||||
bool predicated = !(flags & PIPE_QUERY_WAIT) && !q->stalled;
|
||||
|
||||
struct mi_builder b;
|
||||
mi_builder_init(&b, &batch->screen->devinfo, batch);
|
||||
|
|
|
@ -651,7 +651,7 @@ iris_get_query_result(struct pipe_context *ctx,
|
|||
static void
|
||||
iris_get_query_result_resource(struct pipe_context *ctx,
|
||||
struct pipe_query *query,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *p_res,
|
||||
|
@ -709,7 +709,7 @@ iris_get_query_result_resource(struct pipe_context *ctx,
|
|||
return;
|
||||
}
|
||||
|
||||
bool predicated = !wait && !q->stalled;
|
||||
bool predicated = !(flags & PIPE_QUERY_WAIT) && !q->stalled;
|
||||
|
||||
struct mi_builder b;
|
||||
mi_builder_init(&b, &batch->screen->devinfo, batch);
|
||||
|
|
|
@ -204,7 +204,7 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
|
|||
static void
|
||||
llvmpipe_get_query_result_resource(struct pipe_context *pipe,
|
||||
struct pipe_query *q,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -221,7 +221,7 @@ llvmpipe_get_query_result_resource(struct pipe_context *pipe,
|
|||
if (!lp_fence_issued(pq->fence))
|
||||
llvmpipe_flush(pipe, NULL, __FUNCTION__);
|
||||
|
||||
if (wait)
|
||||
if (flags & PIPE_QUERY_WAIT)
|
||||
lp_fence_wait(pq->fence);
|
||||
}
|
||||
unsignalled = !lp_fence_signalled(pq->fence);
|
||||
|
|
|
@ -77,7 +77,7 @@ nvc0_get_query_result(struct pipe_context *pipe, struct pipe_query *pq,
|
|||
static void
|
||||
nvc0_get_query_result_resource(struct pipe_context *pipe,
|
||||
struct pipe_query *pq,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -88,7 +88,7 @@ nvc0_get_query_result_resource(struct pipe_context *pipe,
|
|||
assert(!"Unexpected lack of get_query_result_resource");
|
||||
return;
|
||||
}
|
||||
q->funcs->get_query_result_resource(nvc0_context(pipe), q, wait, result_type,
|
||||
q->funcs->get_query_result_resource(nvc0_context(pipe), q, flags, result_type,
|
||||
index, resource, offset);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ struct nvc0_query_funcs {
|
|||
bool, union pipe_query_result *);
|
||||
void (*get_query_result_resource)(struct nvc0_context *nvc0,
|
||||
struct nvc0_query *q,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
|
|
@ -387,7 +387,7 @@ nvc0_hw_get_query_result(struct nvc0_context *nvc0, struct nvc0_query *q,
|
|||
static void
|
||||
nvc0_hw_get_query_result_resource(struct nvc0_context *nvc0,
|
||||
struct nvc0_query *q,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -432,7 +432,7 @@ nvc0_hw_get_query_result_resource(struct nvc0_context *nvc0,
|
|||
if (hq->state != NVC0_HW_QUERY_STATE_READY)
|
||||
nvc0_hw_query_update(nvc0->screen->base.client, q);
|
||||
|
||||
if (wait && hq->state != NVC0_HW_QUERY_STATE_READY)
|
||||
if ((flags & PIPE_QUERY_WAIT) && hq->state != NVC0_HW_QUERY_STATE_READY)
|
||||
nvc0_hw_query_fifo_wait(nvc0, q);
|
||||
|
||||
nouveau_pushbuf_space(push, 32, 2, 3);
|
||||
|
@ -493,7 +493,7 @@ nvc0_hw_get_query_result_resource(struct nvc0_context *nvc0,
|
|||
PUSH_DATA(push, 0);
|
||||
}
|
||||
|
||||
if (wait || hq->state == NVC0_HW_QUERY_STATE_READY) {
|
||||
if ((flags & PIPE_QUERY_WAIT) || hq->state == NVC0_HW_QUERY_STATE_READY) {
|
||||
PUSH_DATA(push, 0);
|
||||
PUSH_DATA(push, 0);
|
||||
} else if (hq->is64bit) {
|
||||
|
|
|
@ -560,7 +560,7 @@ static bool r600_query_hw_prepare_buffer(struct r600_common_screen *rscreen,
|
|||
|
||||
static void r600_query_hw_get_result_resource(struct r600_common_context *rctx,
|
||||
struct r600_query *rquery,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -1307,7 +1307,7 @@ static bool r600_get_query_result(struct pipe_context *ctx,
|
|||
|
||||
static void r600_get_query_result_resource(struct pipe_context *ctx,
|
||||
struct pipe_query *query,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -1316,7 +1316,7 @@ static void r600_get_query_result_resource(struct pipe_context *ctx,
|
|||
struct r600_common_context *rctx = (struct r600_common_context *)ctx;
|
||||
struct r600_query *rquery = (struct r600_query *)query;
|
||||
|
||||
rquery->ops->get_result_resource(rctx, rquery, wait, result_type, index,
|
||||
rquery->ops->get_result_resource(rctx, rquery, flags, result_type, index,
|
||||
resource, offset);
|
||||
}
|
||||
|
||||
|
@ -1599,7 +1599,7 @@ static void r600_restore_qbo_state(struct r600_common_context *rctx,
|
|||
|
||||
static void r600_query_hw_get_result_resource(struct r600_common_context *rctx,
|
||||
struct r600_query *rquery,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -1728,7 +1728,7 @@ static void r600_query_hw_get_result_resource(struct r600_common_context *rctx,
|
|||
|
||||
rctx->b.set_shader_buffers(&rctx->b, PIPE_SHADER_COMPUTE, 0, 3, ssbo, ~0);
|
||||
|
||||
if (wait && qbuf == &query->buffer) {
|
||||
if ((flags & PIPE_QUERY_WAIT) && qbuf == &query->buffer) {
|
||||
uint64_t va;
|
||||
|
||||
/* Wait for result availability. Wait only for readiness
|
||||
|
|
|
@ -125,7 +125,8 @@ struct r600_query_ops {
|
|||
struct r600_query *, bool wait,
|
||||
union pipe_query_result *result);
|
||||
void (*get_result_resource)(struct r600_common_context *,
|
||||
struct r600_query *, bool wait,
|
||||
struct r600_query *,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
|
|
@ -276,7 +276,8 @@ static bool gfx10_sh_query_get_result(struct si_context *sctx, struct si_query *
|
|||
}
|
||||
|
||||
static void gfx10_sh_query_get_result_resource(struct si_context *sctx, struct si_query *rquery,
|
||||
bool wait, enum pipe_query_value_type result_type,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index, struct pipe_resource *resource,
|
||||
unsigned offset)
|
||||
{
|
||||
|
@ -388,7 +389,7 @@ static void gfx10_sh_query_get_result_resource(struct si_context *sctx, struct s
|
|||
|
||||
sctx->b.set_constant_buffer(&sctx->b, PIPE_SHADER_COMPUTE, 0, false, &constant_buffer);
|
||||
|
||||
if (wait) {
|
||||
if (flags & PIPE_QUERY_WAIT) {
|
||||
uint64_t va;
|
||||
|
||||
/* Wait for result availability. Wait only for readiness
|
||||
|
|
|
@ -638,7 +638,8 @@ static bool si_query_hw_prepare_buffer(struct si_context *sctx, struct si_query_
|
|||
}
|
||||
|
||||
static void si_query_hw_get_result_resource(struct si_context *sctx, struct si_query *squery,
|
||||
bool wait, enum pipe_query_value_type result_type,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index, struct pipe_resource *resource,
|
||||
unsigned offset);
|
||||
|
||||
|
@ -1372,13 +1373,13 @@ static bool si_get_query_result(struct pipe_context *ctx, struct pipe_query *que
|
|||
}
|
||||
|
||||
static void si_get_query_result_resource(struct pipe_context *ctx, struct pipe_query *query,
|
||||
bool wait, enum pipe_query_value_type result_type,
|
||||
enum pipe_query_flags flags, enum pipe_query_value_type result_type,
|
||||
int index, struct pipe_resource *resource, unsigned offset)
|
||||
{
|
||||
struct si_context *sctx = (struct si_context *)ctx;
|
||||
struct si_query *squery = (struct si_query *)query;
|
||||
|
||||
squery->ops->get_result_resource(sctx, squery, wait, result_type, index, resource, offset);
|
||||
squery->ops->get_result_resource(sctx, squery, flags, result_type, index, resource, offset);
|
||||
}
|
||||
|
||||
static void si_query_hw_clear_result(struct si_query_hw *query, union pipe_query_result *result)
|
||||
|
@ -1423,7 +1424,8 @@ bool si_query_hw_get_result(struct si_context *sctx, struct si_query *squery, bo
|
|||
}
|
||||
|
||||
static void si_query_hw_get_result_resource(struct si_context *sctx, struct si_query *squery,
|
||||
bool wait, enum pipe_query_value_type result_type,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index, struct pipe_resource *resource,
|
||||
unsigned offset)
|
||||
{
|
||||
|
@ -1541,7 +1543,7 @@ static void si_query_hw_get_result_resource(struct si_context *sctx, struct si_q
|
|||
si_resource(resource)->TC_L2_dirty = true;
|
||||
}
|
||||
|
||||
if (wait && qbuf == &query->buffer) {
|
||||
if ((flags & PIPE_QUERY_WAIT) && qbuf == &query->buffer) {
|
||||
uint64_t va;
|
||||
|
||||
/* Wait for result availability. Wait only for readiness
|
||||
|
|
|
@ -133,7 +133,8 @@ struct si_query_ops {
|
|||
bool (*end)(struct si_context *, struct si_query *);
|
||||
bool (*get_result)(struct si_context *, struct si_query *, bool wait,
|
||||
union pipe_query_result *result);
|
||||
void (*get_result_resource)(struct si_context *, struct si_query *, bool wait,
|
||||
void (*get_result_resource)(struct si_context *, struct si_query *,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type, int index,
|
||||
struct pipe_resource *resource, unsigned offset);
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ tegra_get_query_result(struct pipe_context *pcontext,
|
|||
static void
|
||||
tegra_get_query_result_resource(struct pipe_context *pcontext,
|
||||
struct pipe_query *query,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -162,7 +162,7 @@ tegra_get_query_result_resource(struct pipe_context *pcontext,
|
|||
{
|
||||
struct tegra_context *context = to_tegra_context(pcontext);
|
||||
|
||||
context->gpu->get_query_result_resource(context->gpu, query, wait,
|
||||
context->gpu->get_query_result_resource(context->gpu, query, flags,
|
||||
result_type, index, resource,
|
||||
offset);
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ virgl_set_active_query_state(struct pipe_context *pipe, bool enable)
|
|||
static void
|
||||
virgl_get_query_result_resource(struct pipe_context *ctx,
|
||||
struct pipe_query *q,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
@ -247,7 +247,7 @@ virgl_get_query_result_resource(struct pipe_context *ctx,
|
|||
struct virgl_query *query = virgl_query(q);
|
||||
struct virgl_resource *qbo = (struct virgl_resource *)resource;
|
||||
|
||||
virgl_encode_get_query_result_qbo(vctx, query->handle, qbo, wait, result_type, offset, index);
|
||||
virgl_encode_get_query_result_qbo(vctx, query->handle, qbo, (flags & PIPE_QUERY_WAIT), result_type, offset, index);
|
||||
}
|
||||
|
||||
void virgl_init_query_functions(struct virgl_context *vctx)
|
||||
|
|
|
@ -980,7 +980,7 @@ zink_render_condition(struct pipe_context *pctx,
|
|||
static void
|
||||
zink_get_query_result_resource(struct pipe_context *pctx,
|
||||
struct pipe_query *pquery,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *pres,
|
||||
|
|
|
@ -2987,6 +2987,7 @@ static void handle_copy_query_pool_results(struct vk_cmd_queue_entry *cmd,
|
|||
{
|
||||
struct vk_cmd_copy_query_pool_results *copycmd = &cmd->u.copy_query_pool_results;
|
||||
LVP_FROM_HANDLE(lvp_query_pool, pool, copycmd->query_pool);
|
||||
enum pipe_query_flags flags = (copycmd->flags & VK_QUERY_RESULT_WAIT_BIT) ? PIPE_QUERY_WAIT : 0;
|
||||
|
||||
for (unsigned i = copycmd->first_query; i < copycmd->first_query + copycmd->query_count; i++) {
|
||||
unsigned offset = copycmd->dst_offset + lvp_buffer_from_handle(copycmd->dst_buffer)->offset + (copycmd->stride * (i - copycmd->first_query));
|
||||
|
@ -2994,7 +2995,7 @@ static void handle_copy_query_pool_results(struct vk_cmd_queue_entry *cmd,
|
|||
if (copycmd->flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)
|
||||
state->pctx->get_query_result_resource(state->pctx,
|
||||
pool->queries[i],
|
||||
copycmd->flags & VK_QUERY_RESULT_WAIT_BIT,
|
||||
flags,
|
||||
copycmd->flags & VK_QUERY_RESULT_64_BIT ? PIPE_QUERY_TYPE_U64 : PIPE_QUERY_TYPE_U32,
|
||||
-1,
|
||||
lvp_buffer_from_handle(copycmd->dst_buffer)->bo,
|
||||
|
@ -3005,7 +3006,7 @@ static void handle_copy_query_pool_results(struct vk_cmd_queue_entry *cmd,
|
|||
u_foreach_bit(bit, pool->pipeline_stats)
|
||||
state->pctx->get_query_result_resource(state->pctx,
|
||||
pool->queries[i],
|
||||
copycmd->flags & VK_QUERY_RESULT_WAIT_BIT,
|
||||
flags,
|
||||
copycmd->flags & VK_QUERY_RESULT_64_BIT ? PIPE_QUERY_TYPE_U64 : PIPE_QUERY_TYPE_U32,
|
||||
bit,
|
||||
lvp_buffer_from_handle(copycmd->dst_buffer)->bo,
|
||||
|
@ -3013,7 +3014,7 @@ static void handle_copy_query_pool_results(struct vk_cmd_queue_entry *cmd,
|
|||
} else {
|
||||
state->pctx->get_query_result_resource(state->pctx,
|
||||
pool->queries[i],
|
||||
copycmd->flags & VK_QUERY_RESULT_WAIT_BIT,
|
||||
flags,
|
||||
copycmd->flags & VK_QUERY_RESULT_64_BIT ? PIPE_QUERY_TYPE_U64 : PIPE_QUERY_TYPE_U32,
|
||||
0,
|
||||
lvp_buffer_from_handle(copycmd->dst_buffer)->bo,
|
||||
|
|
|
@ -265,7 +265,7 @@ struct pipe_context {
|
|||
*/
|
||||
void (*get_query_result_resource)(struct pipe_context *pipe,
|
||||
struct pipe_query *q,
|
||||
bool wait,
|
||||
enum pipe_query_flags flags,
|
||||
enum pipe_query_value_type result_type,
|
||||
int index,
|
||||
struct pipe_resource *resource,
|
||||
|
|
|
@ -1286,6 +1286,11 @@ enum pipe_query_value_type
|
|||
PIPE_QUERY_TYPE_U64,
|
||||
};
|
||||
|
||||
enum pipe_query_flags
|
||||
{
|
||||
PIPE_QUERY_WAIT = (1 << 0),
|
||||
};
|
||||
|
||||
union pipe_color_union
|
||||
{
|
||||
float f[4];
|
||||
|
|
|
@ -381,10 +381,13 @@ store_query_result(struct gl_context *ctx, struct gl_query_object *q,
|
|||
GLenum pname, GLenum ptype)
|
||||
{
|
||||
struct pipe_context *pipe = ctx->pipe;
|
||||
boolean wait = pname == GL_QUERY_RESULT;
|
||||
enum pipe_query_flags flags = 0;
|
||||
enum pipe_query_value_type result_type;
|
||||
int index;
|
||||
|
||||
if (pname == GL_QUERY_RESULT)
|
||||
flags |= PIPE_QUERY_WAIT;
|
||||
|
||||
/* GL_QUERY_TARGET is a bit of an extension since it has nothing to
|
||||
* do with the GPU end of the query. Write it in "by hand".
|
||||
*/
|
||||
|
@ -462,7 +465,7 @@ store_query_result(struct gl_context *ctx, struct gl_query_object *q,
|
|||
index = 0;
|
||||
}
|
||||
|
||||
pipe->get_query_result_resource(pipe, q->pq, wait, result_type, index,
|
||||
pipe->get_query_result_resource(pipe, q->pq, flags, result_type, index,
|
||||
buf->buffer, offset);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue