zink: tweak zink_create_transient_surface to stop using zink_surface::ivci

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35722>
This commit is contained in:
Mike Blumenkrantz
2025-06-18 16:19:06 -04:00
parent 35cd9f663b
commit b177136c56
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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
+5 -5
View File
@@ -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
+1 -1
View File
@@ -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