X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Ffreedreno%2Fvulkan%2Ftu_image.c;h=657612d42c37fab25dae2771453ab388b51629bb;hb=1bced0fad2feeca34ef9d2a2d28b05e234d25e36;hp=8c91ea504be368614c0068d5035807841e823207;hpb=6cb5fd0d7163a2430f14686faad037912f18b557;p=mesa.git diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 8c91ea504be..657612d42c3 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -283,12 +283,18 @@ tu_GetImageSubresourceLayout(VkDevice _device, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout) { - tu_stub(); + TU_FROM_HANDLE(tu_image, image, _image); + + const uint32_t layer_offset = image->layer_size * pSubresource->arrayLayer; + const struct tu_image_level *level = + image->levels + pSubresource->mipLevel; - /* Even though this is a stub, let's avoid heisenbugs by providing - * deterministic behavior. - */ - memset(pLayout, 0, sizeof(*pLayout)); + pLayout->offset = layer_offset + level->offset; + pLayout->size = level->size; + pLayout->rowPitch = + level->pitch * vk_format_get_blocksize(image->vk_format); + pLayout->arrayPitch = image->layer_size; + pLayout->depthPitch = level->size; } VkResult