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 <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18446>
This commit is contained in:
Mike Blumenkrantz 2022-09-06 12:14:01 -04:00 committed by Marge Bot
parent 4c5dee6c22
commit 758c559bc4

View file

@ -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);