mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
zink: use VkSubresourceLayout::depthPitch as layer_stride when mapping 3D imgs
this is not only more correct according to vk spec, it avoids having a 0-sized layer_stride, which totally breaks the transfer map Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9969>
This commit is contained in:
parent
83bee837e5
commit
ace0b16e8e
1 changed files with 4 additions and 1 deletions
|
|
@ -990,7 +990,10 @@ zink_transfer_map(struct pipe_context *pctx,
|
|||
VkSubresourceLayout srl;
|
||||
vkGetImageSubresourceLayout(screen->dev, res->obj->image, &isr, &srl);
|
||||
trans->base.b.stride = srl.rowPitch;
|
||||
trans->base.b.layer_stride = srl.arrayPitch;
|
||||
if (res->base.b.target == PIPE_TEXTURE_3D)
|
||||
trans->base.b.layer_stride = srl.depthPitch;
|
||||
else
|
||||
trans->base.b.layer_stride = srl.arrayPitch;
|
||||
trans->offset = srl.offset;
|
||||
trans->depthPitch = srl.depthPitch;
|
||||
const struct util_format_description *desc = util_format_description(res->base.b.format);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue