aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-04-14 11:14:31 -0700
committerMarge Bot <[email protected]>2020-04-23 16:37:50 +0000
commit5a8718f01b3976e1bc82362a907befef68a7f525 (patch)
tree41cd79d33265f29d7249464bc946017c6d9a77ac /src/freedreno/vulkan
parentbd76a24fd130bb5a45fea72a3041104ccfb4a8d1 (diff)
freedreno: Make the slice pitch be bytes, not pixels.
Back in a2xx, HW pitches were in pixels, so storing that was reasonable. Ever since then, the HW wants pitches in bytes, and we have only one instance of using pitch in pixels in the code (a3xx sysmem path). Flip things around so that only a2xx has to worry about the cpp for looking at pitches. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4558>
Diffstat (limited to 'src/freedreno/vulkan')
-rw-r--r--src/freedreno/vulkan/tu_image.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c
index d6abef74063..c4ac2f8c830 100644
--- a/src/freedreno/vulkan/tu_image.c
+++ b/src/freedreno/vulkan/tu_image.c
@@ -282,8 +282,7 @@ tu_image_view_init(struct tu_image_view *iview,
uint64_t ubwc_addr = image->bo->iova + image->bo_offset +
fdl_ubwc_offset(layout, range->baseMipLevel, range->baseArrayLayer);
- uint32_t pitch = layout->slices[range->baseMipLevel].pitch * layout->cpp /
- util_format_get_blockwidth(layout->format);
+ uint32_t pitch = layout->slices[range->baseMipLevel].pitch;
uint32_t ubwc_pitch = layout->ubwc_slices[range->baseMipLevel].pitch;
uint32_t layer_size = fdl_layer_stride(layout, range->baseMipLevel);
@@ -513,7 +512,7 @@ tu_GetImageSubresourceLayout(VkDevice _device,
pSubresource->arrayLayer);
pLayout->size = slice->size0;
pLayout->rowPitch =
- slice->pitch * vk_format_get_blocksize(image->vk_format);
+ slice->pitch * vk_format_get_blockheight(image->vk_format);
pLayout->arrayPitch = image->layout.layer_size;
pLayout->depthPitch = slice->size0;