diff options
author | Marek Olšák <[email protected]> | 2011-11-10 15:22:34 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-11-10 18:09:10 +0100 |
commit | 9564185b0a1ac54e7188f88e57ed1a8d09d4e7bb (patch) | |
tree | 7cdb20878fe5f36d385d9e7df1003748004c440e | |
parent | cb7c6c30d02ab46efc4ed711b2a632de50157347 (diff) |
r600g: don't suspend queries if they have already been suspended by blitter
And add some assertions.
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 87435147e38..838af30efd5 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -1503,12 +1503,16 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw) void r600_context_flush(struct r600_context *ctx, unsigned flags) { struct r600_block *enable_block = NULL; + bool queries_suspended = false; if (ctx->pm4_cdwords == ctx->init_dwords) return; /* suspend queries */ - r600_context_queries_suspend(ctx); + if (ctx->num_cs_dw_queries_suspend) { + r600_context_queries_suspend(ctx); + queries_suspended = true; + } if (ctx->screen->chip_class >= EVERGREEN) evergreen_context_flush_dest_caches(ctx); @@ -1540,7 +1544,9 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags) r600_init_cs(ctx); /* resume queries */ - r600_context_queries_resume(ctx); + if (queries_suspended) { + r600_context_queries_resume(ctx); + } /* set all valid group as dirty so they get reemited on * next draw command @@ -1837,12 +1843,15 @@ void r600_context_queries_suspend(struct r600_context *ctx) LIST_FOR_EACH_ENTRY(query, &ctx->active_query_list, list) { r600_query_end(ctx, query); } + assert(ctx->num_cs_dw_queries_suspend == 0); } void r600_context_queries_resume(struct r600_context *ctx) { struct r600_query *query; + assert(ctx->num_cs_dw_queries_suspend == 0); + LIST_FOR_EACH_ENTRY(query, &ctx->active_query_list, list) { r600_query_begin(ctx, query); } |