diff --git a/.pick_status.json b/.pick_status.json index b1e8595e0f1..d793bb0f4f8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5174,7 +5174,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 39ca2074998..ea9cb421b3e 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -473,7 +473,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)) { @@ -3523,7 +3523,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 c1b9f1884c5..56527cece2d 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -544,6 +544,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 af4ae8e46da..95a63e2888a 100644 --- a/src/gallium/drivers/panfrost/pan_csf.c +++ b/src/gallium/drivers/panfrost/pan_csf.c @@ -1160,7 +1160,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 2748fa8dc21..96a96476ee7 100644 --- a/src/gallium/drivers/panfrost/pan_jm.c +++ b/src/gallium/drivers/panfrost/pan_jm.c @@ -509,7 +509,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; @@ -556,7 +556,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,