From 33e70015721711382086dcc9b751d6d54ffc63ed Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 17 May 2021 14:01:49 -0400 Subject: [PATCH] aux/trace: fix query handling with tc trace needs to follow the tc rules for queries a little in order to avoid crashing and provide drivers with the same behavior they expect Reviewed-by: Adam Jackson Part-of: --- src/gallium/auxiliary/driver_trace/tr_context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c index 72e83dd..85e0f42 100644 --- a/src/gallium/auxiliary/driver_trace/tr_context.c +++ b/src/gallium/auxiliary/driver_trace/tr_context.c @@ -45,6 +45,7 @@ struct trace_query { + struct threaded_query base; unsigned type; struct pipe_query *query; @@ -224,19 +225,21 @@ trace_context_begin_query(struct pipe_context *_pipe, static bool trace_context_end_query(struct pipe_context *_pipe, - struct pipe_query *query) + struct pipe_query *_query) { struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; bool ret; - query = trace_query_unwrap(query); + struct pipe_query *query = trace_query_unwrap(_query); trace_dump_call_begin("pipe_context", "end_query"); trace_dump_arg(ptr, pipe); trace_dump_arg(ptr, query); + if (tr_ctx->threaded) + threaded_query(query)->flushed = trace_query(_query)->base.flushed; ret = pipe->end_query(pipe, query); trace_dump_call_end(); @@ -261,6 +264,9 @@ trace_context_get_query_result(struct pipe_context *_pipe, trace_dump_arg(ptr, pipe); trace_dump_arg(ptr, query); + if (tr_ctx->threaded) + threaded_query(query)->flushed = trace_query(_query)->base.flushed; + ret = pipe->get_query_result(pipe, query, wait, result); trace_dump_arg_begin("result"); -- 2.7.4