diff options
author | Lionel Landwerlin <[email protected]> | 2018-04-12 11:06:47 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2018-04-23 09:56:53 +0000 |
commit | f581dc608b258294f69a5c069b9592b6a02420b5 (patch) | |
tree | 0efa0e2f7cb392d0f74cf1444789bebe098aca4e | |
parent | e1b87631a9ea7fd77f3847395157bd57dd4a16eb (diff) |
anv: fix number of planes for depth & stencil
We're not counting correctly with depth & stencil images.
Additionally we need to move an assert that is meant just for color
attachments.
v2: Move an assert() (Reported by Craig)
Change aspect mask checks (Francesco)
Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: a62a97933578a ("anv: enable multiple planes per image/imageView")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105994
Reviewed-by: Nanley Chery <[email protected]>
(cherry picked from commit 0a6547014fbe5371f5b7253f2c2640ad0026b184)
-rw-r--r-- | src/intel/vulkan/anv_private.h | 4 | ||||
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index b351c6f63b3..34b664c82b4 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2282,6 +2282,10 @@ anv_image_aspect_get_planes(VkImageAspectFlags aspect_mask) if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT_KHR) planes++; + if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != 0 && + (aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != 0) + planes++; + return planes; } diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index b711aa61d75..360568b4a62 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -875,10 +875,10 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer, struct anv_image_view *iview = framebuffer->attachments[i]; anv_assert(iview->vk_format == att->format); - anv_assert(iview->n_planes == 1); union isl_color_value clear_color = { .u32 = { 0, } }; if (att_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) { + anv_assert(iview->n_planes == 1); assert(att_aspects == VK_IMAGE_ASPECT_COLOR_BIT); color_attachment_compute_aux_usage(cmd_buffer->device, state, i, begin->renderArea, |