diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 6a3dc8db891..d29e3b76de1 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3780,7 +3780,7 @@ framebuffer_surface_init_transient(struct zink_context *ctx, struct pipe_surface { unsigned nr_samples = idx == PIPE_MAX_COLOR_BUFS ? ctx->fb_state.zsbuf.nr_samples : ctx->fb_state.cbufs[idx].nr_samples; if (!zink_screen(ctx->base.screen)->info.have_EXT_multisampled_render_to_single_sampled) - ctx->transients[idx] = zink_create_transient_surface(ctx, zink_surface(psurf), nr_samples); + ctx->transients[idx] = zink_create_transient_surface(ctx, psurf, nr_samples); } static void diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 3fefa5e59e2..52e60b617c4 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -277,14 +277,14 @@ zink_create_surface(struct pipe_context *pctx, } struct zink_surface * -zink_create_transient_surface(struct zink_context *ctx, struct zink_surface *surf, unsigned nr_samples) +zink_create_transient_surface(struct zink_context *ctx, const struct pipe_surface *psurf, unsigned nr_samples) { - struct zink_resource *res = zink_resource(surf->base.texture); + struct zink_resource *res = zink_resource(psurf->texture); struct zink_resource *transient = res->transient; assert(nr_samples > 1); if (!res->transient) { /* transient fb attachment: not cached */ - struct pipe_resource rtempl = *surf->base.texture; + struct pipe_resource rtempl = *psurf->texture; rtempl.nr_samples = nr_samples; rtempl.bind |= ZINK_BIND_TRANSIENT; res->transient = zink_resource(ctx->base.screen->resource_create(ctx->base.screen, &rtempl)); @@ -295,10 +295,10 @@ zink_create_transient_surface(struct zink_context *ctx, struct zink_surface *sur } } - VkImageViewCreateInfo ivci = surf->ivci; + VkImageViewCreateInfo ivci = create_fb_ivci(zink_screen(ctx->base.screen), res, psurf); ivci.image = transient->obj->image; ivci.pNext = NULL; - return zink_get_surface(ctx, &transient->base.b, &surf->base, &ivci); + return zink_get_surface(ctx, &transient->base.b, psurf, &ivci); } void diff --git a/src/gallium/drivers/zink/zink_surface.h b/src/gallium/drivers/zink/zink_surface.h index e3eb584a392..fc3e87fff43 100644 --- a/src/gallium/drivers/zink/zink_surface.h +++ b/src/gallium/drivers/zink/zink_surface.h @@ -59,7 +59,7 @@ zink_create_fb_surface(struct pipe_context *pctx, const struct pipe_surface *templ); struct zink_surface * -zink_create_transient_surface(struct zink_context *ctx, struct zink_surface *surf, unsigned nr_samples); +zink_create_transient_surface(struct zink_context *ctx, const struct pipe_surface *psurf, unsigned nr_samples); /* cube image types are clamped by gallium rules to 2D or 2D_ARRAY viewtypes if not using all layers */ static inline VkImageViewType