vk/image: Stop hardcoding alignment of stencil surfaces
authorChad Versace <chad.versace@intel.com>
Tue, 9 Jun 2015 21:03:44 +0000 (14:03 -0700)
committerChad Versace <chad.versace@intel.com>
Tue, 9 Jun 2015 21:16:56 +0000 (14:16 -0700)
Look up the alignment from anv_tile_info_table.

src/vulkan/image.c

index 89fd1ebf270cadcd51621dd52ddff218f05c8249..6e123e3853037ad0e1a8202bc7c19f053064ef76 100644 (file)
@@ -133,7 +133,7 @@ VkResult anv_image_create(
 
    if (info->has_stencil) {
       const struct anv_tile_info *w_info = &anv_tile_info_table[WMAJOR];
-      image->stencil_offset = ALIGN_U32(image->size, 4096);
+      image->stencil_offset = ALIGN_U32(image->size, w_info->surface_alignment);
       image->stencil_stride = ALIGN_I32(image->extent.width, w_info->width);
       aligned_height = ALIGN_I32(image->extent.height, w_info->height);
       stencil_size = image->stencil_stride * aligned_height;