tu: Return the correct alignment for images
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 27 Mar 2020 11:02:59 +0000 (12:02 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 08:22:58 +0000 (08:22 +0000)
The alignment field was never initialized, so we were just returning an
alignment of 0. Return the alignment from fdl, and while we're here
cleanup some leftovers in tu_private.h.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4357>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4357>

src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_private.h

index 75699e5270612a2ec4be0967096a30ce5ecfbea4..0f72ddf0bed3eae16860697917a418b5794ae96a 100644 (file)
@@ -1703,7 +1703,7 @@ tu_GetImageMemoryRequirements(VkDevice _device,
 
    pMemoryRequirements->memoryTypeBits = 1;
    pMemoryRequirements->size = image->layout.size;
-   pMemoryRequirements->alignment = image->alignment;
+   pMemoryRequirements->alignment = image->layout.base_align;
 }
 
 void
index 6a7dea85ab8718d34853de6965f46f0663418e27..bc96ebb6d2190478161f18c530cadf7d3fe61319 100644 (file)
@@ -1339,13 +1339,6 @@ tu_2d_clear_zs(const VkClearDepthStencilValue *val, VkFormat format, uint32_t bu
 enum a6xx_2d_ifmt tu6_fmt_to_ifmt(enum a6xx_format fmt);
 enum a6xx_depth_format tu6_pipe2depth(VkFormat format);
 
-struct tu_image_level
-{
-   VkDeviceSize offset;
-   VkDeviceSize size;
-   uint32_t pitch;
-};
-
 struct tu_image
 {
    VkImageType type;
@@ -1362,9 +1355,6 @@ struct tu_image
    uint32_t layer_count;
    VkSampleCountFlagBits samples;
 
-
-   uint32_t alignment;
-
    struct fdl_layout layout;
 
    unsigned queue_family_mask;