struct iris_bo *scratch_bos[1 << 4][MESA_SHADER_STAGES];
} shaders;
+ struct {
+ struct iris_query *query;
+ bool condition;
+ } condition;
+
struct {
uint64_t dirty;
uint64_t dirty_for_nos[IRIS_NOS_COUNT];
uint64_t iris_timebase_scale(const struct gen_device_info *devinfo,
uint64_t gpu_timestamp);
+void iris_resolve_conditional_render(struct iris_context *ice);
/* iris_resolve.c */
/* The old condition isn't relevant; we'll update it if necessary */
ice->state.compute_predicate = NULL;
+ ice->condition.query = q;
+ ice->condition.condition = condition;
if (!q) {
ice->state.predicate = IRIS_PREDICATE_STATE_RENDER;
}
}
+void
+iris_resolve_conditional_render(struct iris_context *ice)
+{
+ struct pipe_context *ctx = (void *) ice;
+ struct iris_query *q = ice->condition.query;
+ struct pipe_query *query = (void *) q;
+ union pipe_query_result result;
+
+ if (ice->state.predicate != IRIS_PREDICATE_STATE_USE_BIT)
+ return;
+
+ assert(q);
+
+ iris_get_query_result(ctx, query, true, &result);
+ set_predicate_enable(ice, (q->result != 0) ^ ice->condition.condition);
+}
+
void
iris_init_query_functions(struct pipe_context *ctx)
{