summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-06-04 02:47:35 +0200
committerMarek Olšák <[email protected]>2010-06-04 03:04:16 +0200
commitffd0a2e215d83222f5e1e148b8e7cddeac6025d2 (patch)
tree0e5da8e7cd9dac23a052f21fb0e04f3071b9da52 /src/gallium/drivers/r600/r600_context.c
parent42aad574f2536d8bf0dc38a2e02d9ddd0630d895 (diff)
r600g: use cast wrappers
Diffstat (limited to 'src/gallium/drivers/r600/r600_context.c')
-rw-r--r--src/gallium/drivers/r600/r600_context.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_context.c b/src/gallium/drivers/r600/r600_context.c
index d819c141485..22fffc4f47b 100644
--- a/src/gallium/drivers/r600/r600_context.c
+++ b/src/gallium/drivers/r600/r600_context.c
@@ -35,7 +35,7 @@
static void r600_destroy_context(struct pipe_context *context)
{
- struct r600_context *rctx = (struct r600_context*)context;
+ struct r600_context *rctx = r600_context(context);
FREE(rctx);
}
@@ -43,8 +43,8 @@ static void r600_destroy_context(struct pipe_context *context)
static void r600_flush(struct pipe_context *ctx, unsigned flags,
struct pipe_fence_handle **fence)
{
- struct r600_context *rctx = (struct r600_context*)ctx;
- struct r600_screen *rscreen = (struct r600_screen*)ctx->screen;
+ struct r600_context *rctx = r600_context(ctx);
+ struct r600_screen *rscreen = rctx->screen;
static int dc = 0;
if (radeon_ctx_pm4(rctx->ctx))
@@ -78,6 +78,11 @@ struct pipe_context *r600_create_context(struct pipe_screen *screen, void *priv)
rctx->context.draw_elements = r600_draw_elements;
rctx->context.draw_range_elements = r600_draw_range_elements;
rctx->context.flush = r600_flush;
+
+ /* Easy accessing of screen/winsys. */
+ rctx->screen = rscreen;
+ rctx->rw = rscreen->rw;
+
r600_init_query_functions(rctx);
r600_init_state_functions(rctx);
r600_init_context_resource_functions(rctx);