asahi: fix i/a queries with tess

fixes new CTS additions to KHR-GL46.pipeline_statistics_query_tests_ARB.functional_tess_queries

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33984>
This commit is contained in:
Alyssa Rosenzweig 2025-04-09 12:31:13 -04:00 committed by Marge Bot
parent 27d2bd5925
commit 141f0ef4e4

View file

@ -4925,21 +4925,11 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
return;
}
if (info->mode == MESA_PRIM_PATCHES) {
agx_draw_patches(ctx, info, drawid_offset, indirect, draws, num_draws);
return;
}
/* We must legalize feedback loops before getting the batch, since once we
* have the batch we're not allowed to flush the bound render targets.
*/
agx_legalize_feedback_loops(ctx);
/* Only the rasterization stream counts */
if (ctx->active_queries && ctx->prims_generated[0] &&
!ctx->stage[PIPE_SHADER_GEOMETRY].shader) {
assert(!indirect && "we force a passthrough GS for this");
agx_primitives_update_direct(ctx, info, draws);
}
struct agx_batch *batch = agx_get_batch(ctx);
uint64_t ib = 0;
size_t ib_extent = 0;
@ -4949,7 +4939,11 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
agx_index_buffer_ptr(batch, info, indirect ? NULL : draws, &ib_extent);
}
if (ctx->active_queries && !ctx->active_draw_without_restart &&
/* Increment IA statistics before lowering tessellation. This ensures we
* count the patches instead of counting the tessellated outputs.
*/
if (ctx->active_queries && !ctx->in_tess &&
!ctx->active_draw_without_restart &&
(ctx->pipeline_statistics[PIPE_STAT_QUERY_IA_VERTICES] ||
ctx->pipeline_statistics[PIPE_STAT_QUERY_IA_PRIMITIVES] ||
ctx->pipeline_statistics[PIPE_STAT_QUERY_VS_INVOCATIONS] ||
@ -4969,6 +4963,19 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
info->index_size ? ib_extent / info->index_size : 1);
}
if (info->mode == MESA_PRIM_PATCHES) {
agx_draw_patches(ctx, info, drawid_offset, indirect, draws, num_draws);
return;
}
/* Only the rasterization stream counts */
if (ctx->active_queries && ctx->prims_generated[0] &&
!ctx->stage[PIPE_SHADER_GEOMETRY].shader) {
assert(!indirect && "we force a passthrough GS for this");
agx_primitives_update_direct(ctx, info, draws);
}
if (ctx->stage[PIPE_SHADER_GEOMETRY].shader && info->primitive_restart &&
info->index_size) {