summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2015-10-02 16:11:24 -0700
committerNanley Chery <[email protected]>2015-11-09 15:41:41 -0800
commit41cf35d1d86e2075b736db7701764d66ea894b66 (patch)
tree6887593ea822d88f4c63ff9728d1565b832356ca /src/vulkan
parent381f602c6bca3d2eeef8bbeb6a96260bf93327a9 (diff)
anv/image: Determine the alignment units for compressed formats
Alignment units, i and j, match the compressed format block width and height respectively. v2: Don't assert against HALIGN* and VALIGN* enums (Chad) Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/vulkan')
-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 affabd1aebf..247a75dd8f4 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -152,8 +152,10 @@ anv_image_make_surface(const struct anv_image_create_info *create_info,
const struct anv_tile_info *tile_info =
&anv_tile_info_table[tile_mode];
- const uint32_t i = 4; /* FINISHME: Stop hardcoding subimage alignment */
- const uint32_t j = 4; /* FINISHME: Stop hardcoding subimage alignment */
+ const uint32_t i = MAX(4, format->bw); /* FINISHME: Stop hardcoding subimage alignment */
+ const uint32_t j = MAX(4, format->bh); /* FINISHME: Stop hardcoding subimage alignment */
+ assert(i == 4 || i == 8 || i == 16);
+ assert(j == 4 || j == 8 || j == 16);
uint16_t qpitch = min_qpitch;
uint32_t mt_width = 0;