From 9e8a6f801d360f85cc7bb53b85f15129b07b26da Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Wed, 19 May 2010 18:46:45 +0200 Subject: r600g: various fixes - enabled flushing a buffer more than once - enabled the blitter for r600_clear - added some more colors to r600_is_format_supported (copied from r600_conv_pipe_format) - r600_set_framebuffer_state now sets rctx->fb_state - more states are saved before a blit (had to add some accounting for the viewport and the vertex elements state) - fixed a few errors with reference counting --- src/gallium/drivers/r600/r600_state.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/gallium/drivers/r600/r600_state.c') diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index e70ef95c1d..d57e88dd56 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -128,6 +128,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, rctx->db->bo[0] = radeon_bo_incref(rscreen->rw, rstate->bo[0]); rctx->db->nbo = 1; rctx->db->placement[0] = RADEON_GEM_DOMAIN_GTT; + rctx->fb_state = *state; } static void *r600_create_fs_state(struct pipe_context *ctx, @@ -308,6 +309,7 @@ static void r600_set_viewport_state(struct pipe_context *ctx, return; } radeon_draw_set_new(rctx->draw, rstate); + rctx->viewport = state; } static void r600_set_vertex_buffers(struct pipe_context *ctx, @@ -320,12 +322,6 @@ static void r600_set_vertex_buffers(struct pipe_context *ctx, rctx->nvertex_buffer = count; } -/* XXX move this to a more appropriate place */ -struct r600_vertex_elements_state -{ - unsigned count; - struct pipe_vertex_element elements[32]; -}; static void *r600_create_vertex_elements_state(struct pipe_context *ctx, unsigned count, @@ -344,8 +340,7 @@ static void r600_bind_vertex_elements_state(struct pipe_context *ctx, void *stat struct r600_context *rctx = (struct r600_context*)ctx; struct r600_vertex_elements_state *v = (struct r600_vertex_elements_state*)state; - memcpy(rctx->vertex_element, v->elements, v->count * sizeof(struct pipe_vertex_element)); - rctx->nvertex_element = v->count; + rctx->vertex_elements = v; } static void r600_delete_vertex_elements_state(struct pipe_context *ctx, void *state) -- cgit v1.2.3