diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 16337b01850..05d9e9c41fb 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -315,7 +315,7 @@ svga_clear_texture(struct pipe_context *pipe, svga_validate_surface_view(svga, svga_surface_dst); if (!dsv) { - pipe_surface_reference(&surface, NULL); + svga_surface_destroy(pipe, surface); return; } @@ -355,7 +355,7 @@ svga_clear_texture(struct pipe_context *pipe, svga_validate_surface_view(svga, svga_surface_dst); if (!rtv) { - pipe_surface_reference(&surface, NULL); + svga_surface_destroy(pipe, surface); return; } @@ -430,7 +430,7 @@ svga_clear_texture(struct pipe_context *pipe, } } } - pipe_surface_reference(&surface, NULL); + svga_surface_destroy(pipe, surface); } diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index ed13eeb60d4..594abc8c69a 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -627,7 +627,7 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s) } -static void +void svga_surface_destroy(struct pipe_context *pipe, struct pipe_surface *surf) { diff --git a/src/gallium/drivers/svga/svga_surface.h b/src/gallium/drivers/svga/svga_surface.h index 5afc49a2fa2..a43462a8ce1 100644 --- a/src/gallium/drivers/svga/svga_surface.h +++ b/src/gallium/drivers/svga/svga_surface.h @@ -140,6 +140,10 @@ svga_create_surface(struct pipe_context *pipe, struct pipe_resource *pt, const struct pipe_surface *surf_tmpl); +void +svga_surface_destroy(struct pipe_context *pipe, + struct pipe_surface *surf); + static inline struct svga_surface * svga_surface(struct pipe_surface *surface) {