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; /*