vk/image: Don't double-allocate stencil buffers
authorChad Versace <chad.versace@intel.com>
Tue, 9 Jun 2015 22:01:18 +0000 (15:01 -0700)
committerChad Versace <chad.versace@intel.com>
Tue, 9 Jun 2015 23:39:28 +0000 (16:39 -0700)
If the main surface has format S8_UINT, then don't allocate the
auxiliary stencil surface.

src/vulkan/image.c

index 814265889450188e7b2cf546e2f727ac03995d34..40d5024a0ebfadabd9939e5e57ba9c51b7dd2492 100644 (file)
@@ -142,7 +142,7 @@ VkResult anv_image_create(
       image->stride = 0;
    }
 
-   if (info->has_stencil) {
+   if (info->has_stencil && pCreateInfo->format != VK_FORMAT_S8_UINT) {
       const struct anv_tile_info *w_info = &anv_tile_info_table[WMAJOR];
       image->stencil_offset = ALIGN_U32(image->size, w_info->surface_alignment);
       image->stencil_stride = ALIGN_I32(image->extent.width, w_info->width);