svga: simplify some surface management

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40462>
This commit is contained in:
Mike Blumenkrantz 2026-03-16 11:43:23 -04:00 committed by Marge Bot
parent 17d9f1dc64
commit a4c0f5ba6f
3 changed files with 8 additions and 4 deletions

View file

@ -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);
}

View file

@ -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)
{

View file

@ -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)
{