From: Chad Versace Date: Fri, 28 Aug 2015 15:08:12 +0000 (-0700) Subject: vk/meta: Support stencil in vkCmdCopyImageToBuffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2d15ee698a377c41c8c7b7414a6202d93ba1d96;p=mesa.git vk/meta: Support stencil in vkCmdCopyImageToBuffer At Crucible commit 12e64a4, fixes the func.depthstencil.stencil-triangles.* tests on Broadwell. --- diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index 63d9b3f3e47..c1dcb771819 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -1230,12 +1230,17 @@ void anv_CmdCopyImageToBuffer( }, cmd_buffer); + VkFormat dest_format = src_image->format->vk_format; + if (dest_format == VK_FORMAT_S8_UINT) { + dest_format = VK_FORMAT_R8_UINT; + } + VkImage destImage; anv_CreateImage(vk_device, &(VkImageCreateInfo) { .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, .imageType = VK_IMAGE_TYPE_2D, - .format = src_image->format->vk_format, + .format = dest_format, .extent = { .width = pRegions[r].imageExtent.width, .height = pRegions[r].imageExtent.height, @@ -1262,7 +1267,7 @@ void anv_CmdCopyImageToBuffer( &(VkAttachmentViewCreateInfo) { .sType = VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO, .image = destImage, - .format = src_image->format->vk_format, + .format = dest_format, .mipLevel = 0, .baseArraySlice = 0, .arraySize = 1,