From 758c559bc45924554c5602e145b87fbfb8fb2a2b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 6 Sep 2022 12:14:01 -0400 Subject: [PATCH] zink: check format compatibility up front when creating framebuffer surface this avoids an assert in create_ivci while enforcing correct behavior cc: mesa-stable Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 837853f..b9723ea 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -263,6 +263,9 @@ zink_create_surface(struct pipe_context *pctx, /* mutable not set by default */ zink_resource_object_init_mutable(zink_context(pctx), res); + if (!zink_get_format(zink_screen(pctx->screen), templ->format)) + return NULL; + VkImageViewCreateInfo ivci = create_ivci(zink_screen(pctx->screen), res, templ, pres->target == PIPE_TEXTURE_3D ? target_2d[is_array] : pres->target); -- 2.7.4