iris: Save/restore MI_PREDICATE_RESULT, not MI_PREDICATE_DATA.

MI_PREDICATE_DATA is an intermediate storage for the MI_PREDICATE
command's calculations - it holds the result of the subtraction when
the compare operation is SRCS_EQUAL or DELTAS_EQUAL.  But the actual
result of the predication is MI_PREDICATE_RESULT, which is what we
want to copy from the render context to the compute context.
This commit is contained in:
Kenneth Graunke 2019-04-01 23:28:06 -07:00
parent d1dd3cbcc7
commit 8d9e169bdd
3 changed files with 8 additions and 8 deletions

View File

@ -598,7 +598,7 @@ struct iris_context {
enum iris_predicate_state predicate; enum iris_predicate_state predicate;
/** /**
* Query BO with a MI_PREDICATE_DATA snapshot calculated on the * Query BO with a MI_PREDICATE_RESULT snapshot calculated on the
* render context that needs to be uploaded to the compute context. * render context that needs to be uploaded to the compute context.
*/ */
struct iris_bo *compute_predicate; struct iris_bo *compute_predicate;

View File

@ -232,7 +232,7 @@ iris_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info *grid)
ice->vtbl.update_surface_base_address(batch, &ice->state.binder); ice->vtbl.update_surface_base_address(batch, &ice->state.binder);
if (ice->state.compute_predicate) { if (ice->state.compute_predicate) {
ice->vtbl.load_register_mem64(batch, MI_PREDICATE_DATA, ice->vtbl.load_register_mem64(batch, MI_PREDICATE_RESULT,
ice->state.compute_predicate, 0); ice->state.compute_predicate, 0);
ice->state.compute_predicate = NULL; ice->state.compute_predicate = NULL;
} }

View File

@ -117,8 +117,8 @@ struct iris_query {
}; };
struct iris_query_snapshots { struct iris_query_snapshots {
/** iris_render_condition's saved MI_PREDICATE_DATA value. */ /** iris_render_condition's saved MI_PREDICATE_RESULT value. */
uint64_t predicate_data; uint64_t predicate_result;
/** Have the start/end snapshots landed? */ /** Have the start/end snapshots landed? */
uint64_t snapshots_landed; uint64_t snapshots_landed;
@ -129,7 +129,7 @@ struct iris_query_snapshots {
}; };
struct iris_query_so_overflow { struct iris_query_so_overflow {
uint64_t predicate_data; uint64_t predicate_result;
uint64_t snapshots_landed; uint64_t snapshots_landed;
struct { struct {
@ -1048,12 +1048,12 @@ set_predicate_for_result(struct iris_context *ice,
/* We immediately set the predicate on the render batch, as all the /* We immediately set the predicate on the render batch, as all the
* counters come from 3D operations. However, we may need to predicate * counters come from 3D operations. However, we may need to predicate
* a compute dispatch, which executes in a different GEM context and has * a compute dispatch, which executes in a different GEM context and has
* a different MI_PREDICATE_DATA register. So, we save the result to * a different MI_PREDICATE_RESULT register. So, we save the result to
* memory and reload it in iris_launch_grid. * memory and reload it in iris_launch_grid.
*/ */
unsigned offset = q->query_state_ref.offset + unsigned offset = q->query_state_ref.offset +
offsetof(struct iris_query_snapshots, predicate_data); offsetof(struct iris_query_snapshots, predicate_result);
ice->vtbl.store_register_mem64(batch, MI_PREDICATE_DATA, ice->vtbl.store_register_mem64(batch, MI_PREDICATE_RESULT,
bo, offset, false); bo, offset, false);
ice->state.compute_predicate = bo; ice->state.compute_predicate = bo;
} }