/* Acc query state will have been dirtied by our fd_batch_update_queries, so
* the ctx->batch may need to turn its queries back on.
*/
- ctx->update_active_queries = true;
+ fd_context_dirty(ctx, FD_DIRTY_QUERY);
return true;
}
/* Acc query state will have been dirtied by our fd_batch_update_queries, so
* the ctx->batch may need to turn its queries back on.
*/
- ctx->update_active_queries = true;
+ fd_context_dirty(ctx, FD_DIRTY_QUERY);
return;
/* Acc query state will have been dirtied by our fd_batch_update_queries, so
* the ctx->batch may need to turn its queries back on.
*/
- ctx->update_active_queries = true;
+ fd_context_dirty(ctx, FD_DIRTY_QUERY);
return true;
}
{
struct fd_context *ctx = batch->ctx;
- if (!ctx->update_active_queries)
+ if (!(ctx->dirty & FD_DIRTY_QUERY))
return;
ctx->query_update_batch(batch, false);
FD_DIRTY_TEX = BIT(17),
FD_DIRTY_IMAGE = BIT(18),
FD_DIRTY_SSBO = BIT(19),
+ FD_DIRTY_QUERY = BIT(20),
/* only used by a2xx.. possibly can be removed.. */
- FD_DIRTY_TEXSTATE = BIT(20),
+ FD_DIRTY_TEXSTATE = BIT(21),
/* fine grained state changes, for cases where state is not orthogonal
* from hw perspective:
float default_inner_level[2] dt;
uint8_t patch_vertices dt;
- /* Whether we need to recheck the active_queries list next
- * fd_batch_update_queries().
- */
- bool update_active_queries dt;
-
/* Current state of pctx->set_active_query_state() (i.e. "should drawing
* be counted against non-perfcounter queries")
*/
{
return dirty & (FD_DIRTY_FRAMEBUFFER | FD_DIRTY_ZSA | FD_DIRTY_BLEND |
FD_DIRTY_SSBO | FD_DIRTY_IMAGE | FD_DIRTY_VTXBUF |
- FD_DIRTY_TEX | FD_DIRTY_STREAMOUT);
+ FD_DIRTY_TEX | FD_DIRTY_STREAMOUT | FD_DIRTY_QUERY);
}
/* Mark specified non-shader-stage related state as dirty: */
resource_written(batch, ctx->streamout.targets[i]->buffer);
}
+ if (ctx->dirty & FD_DIRTY_QUERY) {
+ list_for_each_entry (struct fd_acc_query, aq, &ctx->acc_active_queries, node) {
+ resource_written(batch, aq->prsc);
+ }
+ }
+
/* any buffers that haven't been cleared yet, we need to restore: */
batch->restore |= restore_buffers & (FD_BUFFER_ALL & ~batch->invalidated);
/* and any buffers used, need to be resolved: */
resource_written(batch, batch->query_buf);
- list_for_each_entry (struct fd_acc_query, aq, &ctx->acc_active_queries, node)
- resource_written(batch, aq->prsc);
-
fd_screen_unlock(ctx->screen);
}
{
struct fd_context *ctx = fd_context(pctx);
ctx->active_queries = enable;
- ctx->update_active_queries = true;
+ fd_context_dirty(ctx, FD_DIRTY_QUERY);
}
static enum pipe_driver_query_type
realloc_query_bo(ctx, aq);
/* Signal that we need to update the active queries on the next draw */
- ctx->update_active_queries = true;
+ fd_context_dirty(ctx, FD_DIRTY_QUERY);
/* add to active list: */
assert(list_is_empty(&aq->node));
{
struct fd_context *ctx = batch->ctx;
- if (disable_all || ctx->update_active_queries) {
+ if (disable_all || (ctx->dirty & FD_DIRTY_QUERY)) {
struct fd_acc_query *aq;
LIST_FOR_EACH_ENTRY (aq, &ctx->acc_active_queries, node) {
bool batch_change = aq->batch != batch;
fd_acc_query_resume(aq, batch);
}
}
-
- ctx->update_active_queries = false;
}
void
{
struct fd_context *ctx = batch->ctx;
- if (disable_all || ctx->update_active_queries) {
+ if (disable_all || (ctx->dirty & FD_DIRTY_QUERY)) {
struct fd_hw_query *hq;
LIST_FOR_EACH_ENTRY (hq, &batch->ctx->hw_active_queries, list) {
bool was_active = query_active_in_batch(batch, hq);
fd_batch_reference(&ctx->batch, NULL);
fd_context_all_dirty(ctx);
- ctx->update_active_queries = true;
fd_batch_reference(&old_batch, NULL);
} else if (ctx->batch) {