summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_context.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-08-17 16:07:23 +1000
committerJerome Glisse <[email protected]>2010-08-20 16:43:44 +0200
commit63d010115c7972d854e0583f8f74e8d0c3407fcd (patch)
tree9b24f913c6141dc0ed871ba331d094eddafe74e3 /src/gallium/drivers/r600/r600_context.c
parent3aaec4750d6fda39b3bb4fc0a159fba1655feede (diff)
r600g: add occlusion query support
Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_context.c')
-rw-r--r--src/gallium/drivers/r600/r600_context.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_context.c b/src/gallium/drivers/r600/r600_context.c
index edde80c660a..2f59a550f56 100644
--- a/src/gallium/drivers/r600/r600_context.c
+++ b/src/gallium/drivers/r600/r600_context.c
@@ -34,6 +34,7 @@
#include "r600_resource.h"
#include "r600d.h"
+
static void r600_destroy_context(struct pipe_context *context)
{
struct r600_context *rctx = r600_context(context);
@@ -46,26 +47,34 @@ void r600_flush(struct pipe_context *ctx, unsigned flags,
{
struct r600_context *rctx = r600_context(ctx);
struct r600_screen *rscreen = rctx->screen;
+ struct r600_query *rquery;
static int dc = 0;
char dname[256];
+ /* suspend queries */
+ r600_queries_suspend(rctx);
if (radeon_ctx_pm4(rctx->ctx))
- return;
+ goto out;
/* FIXME dumping should be removed once shader support instructions
* without throwing bad code
*/
if (!rctx->ctx->cpm4)
goto out;
sprintf(dname, "gallium-%08d.bof", dc);
- if (dc < 1)
+ if (dc < 10)
radeon_ctx_dump_bof(rctx->ctx, dname);
#if 1
radeon_ctx_submit(rctx->ctx);
#endif
+ LIST_FOR_EACH_ENTRY(rquery, &rctx->query_list, list) {
+ rquery->flushed = true;
+ }
dc++;
out:
rctx->ctx = radeon_ctx_decref(rctx->ctx);
rctx->ctx = radeon_ctx(rscreen->rw);
+ /* resume queries */
+ r600_queries_resume(rctx);
}
static void r600_init_config(struct r600_context *rctx)