anv/cmd_buffer: Adjust layout transition aspect checking
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 12 Jun 2017 18:26:47 +0000 (11:26 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Mon, 26 Jun 2017 18:09:12 +0000 (11:09 -0700)
Reflect the fact that an image view or subresource range with the color
aspect cannot have any other aspect.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_cmd_buffer.c

index 0216ea04a807ae66d5caa2b4f7ab2e4ce931e0dc..69b48121855f58bf2804ecdfb014f6d0f9e6b2ed 100644 (file)
@@ -992,9 +992,8 @@ void genX(CmdPipelineBarrier)(
          transition_depth_buffer(cmd_buffer, image,
                                  pImageMemoryBarriers[i].oldLayout,
                                  pImageMemoryBarriers[i].newLayout);
-      }
-      if (pImageMemoryBarriers[i].subresourceRange.aspectMask &
-          VK_IMAGE_ASPECT_COLOR_BIT) {
+      } else if (pImageMemoryBarriers[i].subresourceRange.aspectMask ==
+                 VK_IMAGE_ASPECT_COLOR_BIT) {
          transition_color_buffer(cmd_buffer, image,
                                  pImageMemoryBarriers[i].oldLayout,
                                  pImageMemoryBarriers[i].newLayout,
@@ -2484,8 +2483,7 @@ cmd_buffer_subpass_transition_layouts(struct anv_cmd_buffer * const cmd_buffer,
          att_state->aux_usage =
             anv_layout_to_aux_usage(&cmd_buffer->device->info, image,
                                     image->aspects, target_layout);
-      }
-      if (image->aspects & VK_IMAGE_ASPECT_COLOR_BIT) {
+      } else if (image->aspects == VK_IMAGE_ASPECT_COLOR_BIT) {
          transition_color_buffer(cmd_buffer, image,
                                  att_state->current_layout, target_layout,
                                  &iview->isl, NULL);