summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2015-09-28 17:51:30 -0700
committerNanley Chery <[email protected]>2015-11-09 15:41:41 -0800
commit300f7c2be34f9d20497b4127020d520de1c09ba5 (patch)
tree12dc73176d2259ea572727071c9bfc77371a7059
parent7b4244dea02c38c194def5ff05636e09124cd6b7 (diff)
anv/image: Handle compressed format stride and size
These formulas did not take compressed formats into account. Reviewed-by: Chad Versace <[email protected]>
-rw-r--r--src/vulkan/anv_image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c
index 8aa74c2e191..7051ac746f2 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -225,11 +225,13 @@ anv_image_make_surface(const struct anv_image_create_info *create_info,
*/
assert(anv_is_aligned(qpitch, j));
- uint32_t stride = align_u32(mt_width * format->bs, tile_info->width);
+ uint32_t stride = align_u32(mt_width * format->bs / format->bw,
+ tile_info->width);
if (create_info->stride > 0)
stride = create_info->stride;
- const uint32_t size = stride * align_u32(mt_height, tile_info->height);
+ const uint32_t size = stride * align_u32(mt_height / format->bh,
+ tile_info->height);
const uint32_t offset = align_u32(*inout_image_size,
tile_info->surface_alignment);