diff --git a/.pick_status.json b/.pick_status.json index fa8c31619fc..d4eba9ce7ee 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1904,7 +1904,7 @@ "description": "panfrost: add helper function for checking for active queries", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 6e2a36c5b27..7472c8c8fea 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -494,7 +494,7 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx, uint64_t *blend_shaders, for (unsigned c = 0; c < rt_count; ++c) has_blend_shader |= (blend_shaders[c] != 0); - bool has_oq = ctx->occlusion_query && ctx->active_queries; + bool has_oq = panfrost_occlusion_query_active(ctx); pan_pack(rsd, RENDERER_STATE, cfg) { if (panfrost_fs_required(fs, so, &ctx->pipe_framebuffer, zsa)) { @@ -3563,7 +3563,8 @@ panfrost_draw_indirect(struct pipe_context *pipe, { struct panfrost_context *ctx = pan_context(pipe); - if (!PAN_GPU_SUPPORTS_DRAW_INDIRECT || ctx->active_queries || + if (!PAN_GPU_SUPPORTS_DRAW_INDIRECT || + panfrost_occlusion_query_active(ctx) || ctx->streamout.num_targets) { util_draw_indirect(pipe, info, drawid_offset, indirect); perf_debug(ctx, "Emulating indirect draw on the CPU"); diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index b230ea62e27..6cf759843d8 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -545,6 +545,12 @@ panfrost_clean_state_3d(struct panfrost_context *ctx) } } +static inline bool +panfrost_occlusion_query_active(struct panfrost_context *ctx) +{ + return ctx->occlusion_query && ctx->active_queries; +} + void panfrost_set_batch_masks_blend(struct panfrost_batch *batch); void panfrost_set_batch_masks_zs(struct panfrost_batch *batch); diff --git a/src/gallium/drivers/panfrost/pan_csf.c b/src/gallium/drivers/panfrost/pan_csf.c index 2389926de3b..2246804b85c 100644 --- a/src/gallium/drivers/panfrost/pan_csf.c +++ b/src/gallium/drivers/panfrost/pan_csf.c @@ -1177,7 +1177,7 @@ csf_emit_draw_state(struct panfrost_batch *batch, fui(batch->maximum_z)); #endif - if (ctx->occlusion_query && ctx->active_queries) { + if (panfrost_occlusion_query_active(ctx)) { struct panfrost_resource *rsrc = pan_resource(ctx->occlusion_query->rsrc); cs_move64_to(b, cs_sr_reg64(b, IDVS, OQ), rsrc->plane.base); panfrost_batch_write_rsrc(ctx->batch, rsrc, MESA_SHADER_FRAGMENT); diff --git a/src/gallium/drivers/panfrost/pan_jm.c b/src/gallium/drivers/panfrost/pan_jm.c index 620800d4efb..845c238853e 100644 --- a/src/gallium/drivers/panfrost/pan_jm.c +++ b/src/gallium/drivers/panfrost/pan_jm.c @@ -522,7 +522,7 @@ jm_emit_tiler_draw(struct mali_draw_packed *out, struct panfrost_batch *batch, cfg.front_face_ccw = rast->front_ccw; #endif - if (ctx->occlusion_query && ctx->active_queries) { + if (panfrost_occlusion_query_active(ctx)) { #if PAN_ARCH == 9 if (ctx->occlusion_query->type == PIPE_QUERY_OCCLUSION_COUNTER) cfg.flags_0.occlusion_query = MALI_OCCLUSION_MODE_COUNTER; @@ -569,7 +569,7 @@ jm_emit_tiler_draw(struct mali_draw_packed *out, struct panfrost_batch *batch, cfg.flags_0.multisample_enable = true; if (fs_required) { - bool has_oq = ctx->occlusion_query && ctx->active_queries; + bool has_oq = panfrost_occlusion_query_active(ctx); struct pan_earlyzs_state earlyzs = pan_earlyzs_get( fs->earlyzs, ctx->depth_stencil->writes_zs || has_oq,