Module: Mesa Branch: main Commit: b1737856adf56c53869b35dd24cefafe5a5a1a44 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1737856adf56c53869b35dd24cefafe5a5a1a44
Author: Mohamed Ahmed <mohamedahmedegypt2...@gmail.com> Date: Sat Nov 25 18:07:50 2023 +0200 nvk: Fix GetImageSubResourceLayout for non-disjoint images Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26365> --- src/nouveau/vulkan/nvk_image.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 589ba878587..32d5b6e9039 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -774,9 +774,17 @@ nvk_get_image_subresource_layout(UNUSED struct nvk_device *dev, const uint8_t p = nvk_image_aspects_to_plane(image, isr->aspectMask); const struct nvk_image_plane *plane = &image->planes[p]; + uint64_t offset_B = 0; + if (!image->disjoint) { + uint32_t align_B = 0; + for (unsigned plane = 0; plane < p; plane++) + nvk_image_plane_add_req(&image->planes[plane], &offset_B, &align_B); + } + offset_B += nil_image_level_layer_offset_B(&plane->nil, isr->mipLevel, + isr->arrayLayer); + pLayout->subresourceLayout = (VkSubresourceLayout) { - .offset = nil_image_level_layer_offset_B(&plane->nil, isr->mipLevel, - isr->arrayLayer), + .offset = offset_B, .size = nil_image_level_size_B(&plane->nil, isr->mipLevel), .rowPitch = plane->nil.levels[isr->mipLevel].row_stride_B, .arrayPitch = plane->nil.array_stride_B,