att->load_op = pCreateInfo->pAttachments[i].loadOp;
att->store_op = pCreateInfo->pAttachments[i].storeOp;
att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp;
+ att->initial_layout = pCreateInfo->pAttachments[i].initialLayout;
+ att->final_layout = pCreateInfo->pAttachments[i].finalLayout;
att->subpass_usage = usages;
usages += pass->subpass_count;
}
if (desc->pDepthStencilAttachment) {
uint32_t a = desc->pDepthStencilAttachment->attachment;
subpass->depth_stencil_attachment = a;
+ subpass->depth_stencil_layout =
+ desc->pDepthStencilAttachment->layout;
if (a != VK_ATTACHMENT_UNUSED) {
pass->attachments[a].usage |=
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
}
} else {
subpass->depth_stencil_attachment = VK_ATTACHMENT_UNUSED;
+ subpass->depth_stencil_layout = VK_IMAGE_LAYOUT_UNDEFINED;
}
}
struct anv_state color_rt_state;
struct anv_state input_att_state;
+ VkImageLayout current_layout;
VkImageAspectFlags pending_clear_aspects;
bool fast_clear;
VkClearValue clear_value;
uint32_t color_count;
uint32_t * color_attachments;
uint32_t * resolve_attachments;
+
+ /* TODO: Consider storing the depth/stencil VkAttachmentReference
+ * instead of its two structure members (below) individually.
+ */
uint32_t depth_stencil_attachment;
+ VkImageLayout depth_stencil_layout;
/** Subpass has a depth/stencil self-dependency */
bool has_ds_self_dep;
};
struct anv_render_pass_attachment {
+ /* TODO: Consider using VkAttachmentDescription instead of storing each of
+ * its members individually.
+ */
VkFormat format;
uint32_t samples;
VkImageUsageFlags usage;
VkAttachmentLoadOp load_op;
VkAttachmentStoreOp store_op;
VkAttachmentLoadOp stencil_load_op;
+ VkImageLayout initial_layout;
+ VkImageLayout final_layout;
/* An array, indexed by subpass id, of how the attachment will be used. */
enum anv_subpass_usage * subpass_usage;