#include "r600_screen.h"
#include "r600_context.h"
#include "r600_resource.h"
-#include "r600d.h"
-
static void r600_destroy_context(struct pipe_context *context)
{
free(rctx->vs_constant);
free(rctx->vs_resource);
- radeon_ctx_fini(&rctx->ctx);
+ radeon_ctx_fini(rctx->ctx);
FREE(rctx);
}
struct pipe_fence_handle **fence)
{
struct r600_context *rctx = r600_context(ctx);
- struct r600_query *rquery;
- static int dc = 0;
- char dname[256];
+ struct r600_query *rquery = NULL;
/* suspend queries */
r600_queries_suspend(ctx);
- /* FIXME dumping should be removed once shader support instructions
- * without throwing bad code
- */
- if (!rctx->ctx.cdwords)
- goto out;
-#if 0
- sprintf(dname, "gallium-%08d.bof", dc);
- if (dc < 2) {
- radeon_ctx_dump_bof(&rctx->ctx, dname);
- R600_ERR("dumped %s\n", dname);
- }
-#endif
-#if 1
- radeon_ctx_submit(&rctx->ctx);
-#endif
+
+ radeon_ctx_submit(rctx->ctx);
+
LIST_FOR_EACH_ENTRY(rquery, &rctx->query_list, list) {
rquery->flushed = true;
}
- dc++;
-out:
- radeon_ctx_clear(&rctx->ctx);
+
+ radeon_ctx_clear(rctx->ctx);
/* resume queries */
r600_queries_resume(ctx);
}
+void r600_flush_ctx(void *data)
+{
+ struct r600_context *rctx = data;
+
+ rctx->context.flush(&rctx->context, 0, NULL);
+}
+
struct pipe_context *r600_create_context(struct pipe_screen *screen, void *priv)
{
struct r600_context *rctx = CALLOC_STRUCT(r600_context);
rctx->screen = rscreen;
rctx->rw = rscreen->rw;
- rctx->vtbl = &r600_hw_state_vtbl;
+ if (rscreen->chip_class == EVERGREEN)
+ rctx->vtbl = &eg_hw_state_vtbl;
+ else
+ rctx->vtbl = &r600_hw_state_vtbl;
r600_init_blit_functions(rctx);
r600_init_query_functions(rctx);
return NULL;
}
- radeon_ctx_init(&rctx->ctx, rscreen->rw);
+ rctx->ctx = radeon_ctx_init(rscreen->rw);
radeon_draw_init(&rctx->draw, rscreen->rw);
return &rctx->context;
}