}
}
- /* free polygon stipple state */
- if (svga->polygon_stipple.sampler) {
- pipe->delete_sampler_state(pipe, svga->polygon_stipple.sampler);
- }
- if (svga->polygon_stipple.sampler_view) {
- pipe->sampler_view_destroy(pipe,
- &svga->polygon_stipple.sampler_view->base);
- }
- pipe_resource_reference(&svga->polygon_stipple.texture, NULL);
-
/* free HW constant buffers */
for (shader = 0; shader < ARRAY_SIZE(svga->state.hw_draw.constbuf); shader++) {
pipe_resource_reference(&svga->state.hw_draw.constbuf[shader], NULL);
util_blitter_destroy(svga->blitter);
+ svga_cleanup_sampler_state(svga);
svga_cleanup_framebuffer( svga );
svga_cleanup_tss_binding( svga );
-
svga_cleanup_vertex_state(svga);
svga_destroy_swtnl( svga );
void svga_init_clear_functions( struct svga_context *svga );
void svga_cleanup_vertex_state( struct svga_context *svga );
+void svga_cleanup_sampler_state( struct svga_context *svga );
void svga_cleanup_tss_binding( struct svga_context *svga );
void svga_cleanup_framebuffer( struct svga_context *svga );
SVGA_STATS_TIME_POP(svga_sws(svga));
}
+/**
+ * Clean up sampler, sampler view state at context destruction time
+ */
+void
+svga_cleanup_sampler_state(struct svga_context *svga)
+{
+ if (!svga_have_vgpu10(svga))
+ return;
+
+ /* free polygon stipple state */
+ if (svga->polygon_stipple.sampler) {
+ svga->pipe.delete_sampler_state(&svga->pipe, svga->polygon_stipple.sampler);
+ }
+
+ if (svga->polygon_stipple.sampler_view) {
+ svga->pipe.sampler_view_destroy(&svga->pipe,
+ &svga->polygon_stipple.sampler_view->base);
+ }
+ pipe_resource_reference(&svga->polygon_stipple.texture, NULL);
+}
void
svga_init_sampler_functions( struct svga_context *svga )