From 9ffc4f43f97b51afc010f5fb14f23396c5a7f8d7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 16 Mar 2026 12:55:54 -0400 Subject: [PATCH] svga: move surface context member onto internal surface type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/svga/svga_surface.c | 8 ++++---- src/gallium/drivers/svga/svga_surface.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 594abc8c69a..f25fac691ec 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -294,7 +294,7 @@ svga_create_surface_view(struct pipe_context *pipe, pipe_reference_init(&s->base.reference, 1); pipe_resource_reference(&s->base.texture, pt); - s->base.context = pipe; + s->context = pipe; s->base.format = surf_tmpl->format; s->base.level = surf_tmpl->level; s->base.first_layer = surf_tmpl->first_layer; @@ -491,7 +491,7 @@ create_backed_surface_view(struct svga_context *svga, struct svga_surface *s, svga_mark_surface_dirty(s->backed); s->backed->age = tex->age; - assert(s->backed->base.context == &svga->pipe); + assert(s->backed->context == &svga->pipe); done: return s->backed; @@ -541,7 +541,7 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s) * Create an alternate surface view for the specified context if the * view was created for another context. */ - if (s && s->base.context != &svga->pipe) { + if (s && s->context != &svga->pipe) { s = create_backed_surface_view(svga, s, false); if (s) @@ -660,7 +660,7 @@ svga_surface_destroy(struct pipe_context *pipe, * Similar to shader resource view, in this case, we will skip * the destroy for now. */ - if (surf->context != pipe) { + if (s->context != pipe) { _debug_printf("context mismatch in %s\n", __func__); } else { diff --git a/src/gallium/drivers/svga/svga_surface.h b/src/gallium/drivers/svga/svga_surface.h index 6d22ac42906..2f8fe740784 100644 --- a/src/gallium/drivers/svga/svga_surface.h +++ b/src/gallium/drivers/svga/svga_surface.h @@ -26,6 +26,8 @@ struct svga_surface { struct pipe_surface base; + struct pipe_context *context; + struct svga_host_surface_cache_key key; /*