diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 8e4c0013b2c..97e66c30acc 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -1106,7 +1106,7 @@ struct iris_context { * Query BO with a MI_PREDICATE_RESULT snapshot calculated on the * render context that needs to be uploaded to the compute context. */ - struct iris_bo *compute_predicate; + struct iris_address compute_predicate; /** Is a PIPE_QUERY_PRIMITIVES_GENERATED query active? */ bool prims_generated_query_active; diff --git a/src/gallium/drivers/iris/iris_draw.c b/src/gallium/drivers/iris/iris_draw.c index c8743953f40..5ebff010279 100644 --- a/src/gallium/drivers/iris/iris_draw.c +++ b/src/gallium/drivers/iris/iris_draw.c @@ -452,10 +452,11 @@ iris_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info *grid) iris_binder_reserve_compute(ice); batch->screen->vtbl.update_binder_address(batch, &ice->state.binder); - if (ice->state.compute_predicate) { + if (ice->state.compute_predicate.bo) { batch->screen->vtbl.load_register_mem32(batch, MI_PREDICATE_RESULT, - ice->state.compute_predicate, 0); - ice->state.compute_predicate = NULL; + ice->state.compute_predicate.bo, + (uint32_t) ice->state.compute_predicate.offset); + ice->state.compute_predicate.bo = NULL; } iris_handle_always_flush_cache(batch); diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 6f724932cf4..29a5161cbb3 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -837,7 +837,13 @@ set_predicate_for_result(struct iris_context *ice, mi_store(&b, mi_reg32(MI_PREDICATE_RESULT), result); mi_store(&b, query_mem64(q, offsetof(struct iris_query_snapshots, predicate_result)), result); - ice->state.compute_predicate = bo; + + ice->state.compute_predicate = (struct iris_address) { + .bo = bo, + .offset = q->query_state_ref.offset + + offsetof(struct iris_query_snapshots, predicate_result), + .access = IRIS_DOMAIN_OTHER_WRITE + }; iris_batch_sync_region_end(batch); } @@ -852,7 +858,7 @@ iris_render_condition(struct pipe_context *ctx, struct iris_query *q = (void *) query; /* The old condition isn't relevant; we'll update it if necessary */ - ice->state.compute_predicate = NULL; + ice->state.compute_predicate.bo = NULL; if (!q) { ice->state.predicate = IRIS_PREDICATE_STATE_RENDER;