From 234ecf26c65a8909e91313a8b35e2a8a8bbfc0ef Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 13 May 2016 12:50:11 -0700 Subject: anv/image: Add an aspects field This makes several checks easier and allows us to avoid calling anv_format_for_vk_format in a number of cases. --- src/intel/vulkan/gen7_cmd_buffer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/intel/vulkan/gen7_cmd_buffer.c') diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c index 03ce889088a..62d9f4644a1 100644 --- a/src/intel/vulkan/gen7_cmd_buffer.c +++ b/src/intel/vulkan/gen7_cmd_buffer.c @@ -415,9 +415,8 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer) const struct anv_image_view *iview = anv_cmd_buffer_get_depth_stencil_view(cmd_buffer); const struct anv_image *image = iview ? iview->image : NULL; - const struct anv_format *anv_format = - iview ? anv_format_for_vk_format(iview->vk_format) : NULL; - const bool has_depth = iview && anv_format->has_depth; + const bool has_depth = + image && (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT); const uint32_t depth_format = has_depth ? isl_surf_get_depth_format(&cmd_buffer->device->isl_dev, &image->depth_surface.isl) : D16_UNORM; -- cgit v1.2.3