Mesa (master): anv/image: Fix tiling if VkImageSwapchainCreateInfoKHR

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 8 14:38:25 UTC 2021


Module: Mesa
Branch: master
Commit: 12e8e208021875d6826841778bd610a7e5ffc751
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=12e8e208021875d6826841778bd610a7e5ffc751

Author: Chad Versace <chad at kiwitree.net>
Date:   Mon Mar 22 10:49:59 2021 -0700

anv/image: Fix tiling if VkImageSwapchainCreateInfoKHR

We incorrectly used VK_IMAGE_TILING_OPTIMAL when the original swapchain
image had VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT. When we soon begin
using a different memory layout for modifier images, this mismatch would
have produced undefined behavior.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1466>

---

 src/intel/vulkan/anv_image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 7ba3eee1e6c..d6d36738be7 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1042,6 +1042,7 @@ anv_image_from_swapchain(VkDevice device,
     * #swapchain-wsi-image-create-info .
     */
    assert(local_create_info.tiling == VK_IMAGE_TILING_OPTIMAL);
+   local_create_info.tiling = swapchain_image->tiling;
 
    VkImageDrmFormatModifierListCreateInfoEXT local_modifier_info = {
       .sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT,



More information about the mesa-commit mailing list