24 return VK_ATTACHMENT_UNUSED;
30 if (&attachment == idx) {
41 return VkAttachmentReference{
42 findIndexAttachment(reference.attachment),
52 transformAttachmentReference
55 resources.colorAttachments.resize(subpassDescription.
colorAttachments.size());
58 transformAttachmentReference
64 transformAttachmentReference
67 resources.depthStencilAttachment = transformAttachmentReference(subpassDescription.
depthStencilAttachment);
77 const VkSubpassDescription vkSubpassDescription{
90 _subpasses.push_back(std::move(vkSubpassDescription));
99 if (&subpass == idx) {
109 const VkSubpassDependency vkSubpassDependency{
110 findIndexSubpass(subpassDependency.
srcSubpass),
111 findIndexSubpass(subpassDependency.
dstSubpass),
124 const std::vector<VkSubpassDescription> subpasses{std::cbegin(
_subpasses), std::cend(
_subpasses)};
127 const VkRenderPassCreateInfo createInfo{
128 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
131 static_cast<uint32_t
>(attachments.size()),
133 static_cast<uint32_t
>(subpasses.size()),
135 static_cast<uint32_t
>(dependencies.size()),
140 VkRenderPass vkRenderPass{VK_NULL_HANDLE};
141 VkResult result = vkCreateRenderPass(static_cast<VkDevice>(
_device), &createInfo,
nullptr, &vkRenderPass);
144 *returnResult = result;
147 if (result != VK_SUCCESS) {
157 std::unique_ptr<API::RenderPass> renderPass = std::make_unique<API::RenderPass>();
158 return build(*renderPass, returnResult) ? std::move(renderPass) :
nullptr;
VkPipelineStageFlags srcStageMask
RenderPass(const API::Device &device)
AttachmentReference depthStencilAttachment
bool build(API::RenderPass &instance, VkResult *returnResult=nullptr)
AttachmentIndex addAttachment(const VkAttachmentDescription &attachmentDescription)
const API::Device & _device
std::list< VkSubpassDescription > _subpasses
std::list< VkAttachmentDescription > _attachments
VkPipelineBindPoint pipelineBindPoint
VkAccessFlags dstAccessMask
std::vector< AttachmentReference > resolveAttachments
SubpassIndex addSubpass(const SubpassDescription &subpassDescription)
std::vector< VkAttachmentReference > inputAttachments
std::vector< AttachmentReference > inputAttachments
const VkSubpassDescription * SubpassIndex
const VkAttachmentDescription * AttachmentIndex
void addSubpassDependency(const SubpassDependency &subpassDependency)
VkAccessFlags srcAccessMask
VkDependencyFlags dependencyFlags
std::vector< AttachmentReference > colorAttachments
std::list< VkSubpassDependency > _dependencies
VkPipelineStageFlags dstStageMask
std::vector< AttachmentIndex > preserveAttachments
std::list< SubpassResources > _subpassesResources