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);
svga_destroy_swtnl( svga );
- util_bitmask_destroy( svga->vs_bm );
- util_bitmask_destroy( svga->fs_bm );
+ 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 );
}
-struct pipe_context *svga_context_create( struct pipe_screen *screen,
- void *priv )
+struct pipe_context *svga_context_create(struct pipe_screen *screen,
+ void *priv, unsigned flags)
{
struct svga_screen *svgascreen = svga_screen(screen);
struct svga_context *svga = NULL;
if (svga == NULL)
goto no_svga;
+ LIST_INITHEAD(&svga->dirty_buffers);
+
svga->pipe.screen = screen;
svga->pipe.priv = priv;
svga->pipe.destroy = svga_destroy;
svga->debug.no_line_width = debug_get_option_no_line_width();
svga->debug.force_hw_line_stipple = debug_get_option_force_hw_line_stipple();
- svga->fs_bm = util_bitmask_create();
- if (svga->fs_bm == NULL)
- goto no_fs_bm;
-
- svga->vs_bm = util_bitmask_create();
- if (svga->vs_bm == NULL)
- goto no_vs_bm;
+ svga->shader_id_bm = util_bitmask_create();
+ if (svga->shader_id_bm == NULL)
+ goto no_shader_bm;
svga->hwtnl = svga_hwtnl_create(svga);
if (svga->hwtnl == NULL)
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;
- LIST_INITHEAD(&svga->dirty_buffers);
-
return &svga->pipe;
no_state:
no_swtnl:
svga_hwtnl_destroy( svga->hwtnl );
no_hwtnl:
- util_bitmask_destroy( svga->vs_bm );
-no_vs_bm:
- util_bitmask_destroy( svga->fs_bm );
-no_fs_bm:
+ util_bitmask_destroy( svga->shader_id_bm );
+no_shader_bm:
svga->swc->destroy(svga->swc);
no_swc:
FREE(svga);
*/
svga->rebind.rendertargets = TRUE;
svga->rebind.texture_samplers = TRUE;
+ if (svga_have_gb_objects(svga)) {
+ svga->rebind.vs = TRUE;
+ svga->rebind.fs = TRUE;
+ }
if (SVGA_DEBUG & DEBUG_SYNC) {
if (fence)