mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
zink: verify compressed format layer count when creating surfaces
this is illegal for some cases, and mesa/st is equipped to handle per-layer copying here fixes #8283 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
This commit is contained in:
parent
64708f9316
commit
56108b411f
1 changed files with 8 additions and 0 deletions
|
|
@ -277,6 +277,14 @@ zink_create_surface(struct pipe_context *pctx,
|
|||
if (!res->obj->dt && pres->format != templ->format) {
|
||||
/* mutable not set by default */
|
||||
needs_mutable = !(res->base.b.bind & ZINK_BIND_MUTABLE);
|
||||
/*
|
||||
VUID-VkImageViewCreateInfo-image-07072
|
||||
If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and
|
||||
format is a non-compressed format, the levelCount and layerCount members of
|
||||
subresourceRange must both be 1
|
||||
*/
|
||||
if (needs_mutable && util_format_is_compressed(pres->format) && templ->u.tex.first_layer != templ->u.tex.last_layer)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!zink_screen(pctx->screen)->threaded && needs_mutable) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue