llvmpipe: rework query fence signalling for get_query_result_resource
For compute shaders stats avail was never signalling because nothing flushed. Fixes dEQP-VK.query_pool.statistics_query.host_query_reset.compute_shader_invocations.64bits_cmdcopyquerypoolresults_primary and others Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11913>
This commit is contained in:
@@ -214,15 +214,17 @@ llvmpipe_get_query_result_resource(struct pipe_context *pipe,
|
||||
unsigned num_threads = MAX2(1, screen->num_threads);
|
||||
struct llvmpipe_query *pq = llvmpipe_query(q);
|
||||
struct llvmpipe_resource *lpr = llvmpipe_resource(resource);
|
||||
bool unflushed = false;
|
||||
bool unsignalled = false;
|
||||
if (pq->fence) {
|
||||
/* only have a fence if there was a scene */
|
||||
if (!lp_fence_signalled(pq->fence)) {
|
||||
unsignalled = true;
|
||||
if (!lp_fence_issued(pq->fence))
|
||||
unflushed = true;
|
||||
llvmpipe_flush(pipe, NULL, __FUNCTION__);
|
||||
|
||||
if (wait)
|
||||
lp_fence_wait(pq->fence);
|
||||
}
|
||||
unsignalled = !lp_fence_signalled(pq->fence);
|
||||
}
|
||||
|
||||
|
||||
@@ -236,15 +238,6 @@ llvmpipe_get_query_result_resource(struct pipe_context *pipe,
|
||||
else {
|
||||
unsigned i;
|
||||
|
||||
if (unflushed) {
|
||||
llvmpipe_flush(pipe, NULL, __FUNCTION__);
|
||||
|
||||
if (!wait)
|
||||
return;
|
||||
|
||||
lp_fence_wait(pq->fence);
|
||||
}
|
||||
|
||||
switch (pq->type) {
|
||||
case PIPE_QUERY_OCCLUSION_COUNTER:
|
||||
for (i = 0; i < num_threads; i++) {
|
||||
|
||||
Reference in New Issue
Block a user