summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-02-08 09:51:14 -0800
committerBrian Paul <[email protected]>2014-02-14 08:21:44 -0700
commit2f1fc8db108eb771414aa5440d4c439f63f4e7c1 (patch)
treef8e935b4b34d11e41a6b1ed87d05d09f584ea199 /src/gallium/drivers/svga/svga_context.c
parent31dfefc47f9f12c49fd3cfb27ba4fe384cb60380 (diff)
svga: update constant buffer code for GBS
Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.c')
-rw-r--r--src/gallium/drivers/svga/svga_context.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c
index c32051a41db..de769cac95f 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -53,6 +53,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(force_hw_line_stipple, "SVGA_FORCE_HW_LINE_STIPPLE",
static void svga_destroy( struct pipe_context *pipe )
{
struct svga_context *svga = svga_context( pipe );
+ struct svga_winsys_screen *sws = svga_screen(pipe->screen)->sws;
unsigned shader;
util_blitter_destroy(svga->blitter);
@@ -70,8 +71,10 @@ static void svga_destroy( struct pipe_context *pipe )
util_bitmask_destroy( svga->shader_id_bm );
- for(shader = 0; shader < PIPE_SHADER_TYPES; ++shader)
- pipe_resource_reference( &svga->curr.cb[shader], NULL );
+ for (shader = 0; shader < PIPE_SHADER_TYPES; ++shader) {
+ pipe_resource_reference( &svga->curr.cbufs[shader].buffer, NULL );
+ sws->surface_reference(sws, &svga->state.hw_draw.hw_cb[shader], NULL);
+ }
FREE( svga );
}
@@ -147,6 +150,7 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen,
memset(&svga->state.hw_draw, 0xcd, sizeof(svga->state.hw_draw));
memset(&svga->state.hw_draw.views, 0x0, sizeof(svga->state.hw_draw.views));
svga->state.hw_draw.num_views = 0;
+ memset(&svga->state.hw_draw.hw_cb, 0x0, sizeof(svga->state.hw_draw.hw_cb));
svga->dirty = ~0;