diff options
author | Jason Ekstrand <[email protected]> | 2016-05-13 14:07:21 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-17 12:17:22 -0700 |
commit | 9102e88364a7e6a5c66f5b0eb5869ab029cddf92 (patch) | |
tree | 1c606326e3fc161951b88c1bc69a51bde300b961 /src/intel/vulkan/anv_cmd_buffer.c | |
parent | ffc502ce0c422822b8d276d07600a6089c70b4af (diff) |
anv: Change render_pass_attachment.format to a VkFormat
Diffstat (limited to 'src/intel/vulkan/anv_cmd_buffer.c')
-rw-r--r-- | src/intel/vulkan/anv_cmd_buffer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 77f4283f77a..bba24e82337 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -29,6 +29,8 @@ #include "anv_private.h" +#include "vk_format_info.h" + /** \file anv_cmd_buffer.c * * This file contains all of the stuff for emitting commands into a command @@ -168,20 +170,21 @@ anv_cmd_state_setup_attachments(struct anv_cmd_buffer *cmd_buffer, for (uint32_t i = 0; i < pass->attachment_count; ++i) { struct anv_render_pass_attachment *att = &pass->attachments[i]; + VkImageAspectFlags att_aspects = vk_format_aspects(att->format); VkImageAspectFlags clear_aspects = 0; - if (anv_format_is_color(att->format)) { + if (att_aspects == VK_IMAGE_ASPECT_COLOR_BIT) { /* color attachment */ if (att->load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { clear_aspects |= VK_IMAGE_ASPECT_COLOR_BIT; } } else { /* depthstencil attachment */ - if (att->format->has_depth && + if ((att_aspects & VK_IMAGE_ASPECT_DEPTH_BIT) && att->load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { clear_aspects |= VK_IMAGE_ASPECT_DEPTH_BIT; } - if (att->format->has_stencil && + if ((att_aspects & VK_IMAGE_ASPECT_STENCIL_BIT) && att->stencil_load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { clear_aspects |= VK_IMAGE_ASPECT_STENCIL_BIT; } |