Instance a VkAttachmentDescription.
Instance a VkClearValue.
Instance a VkPipelineColorBlendAttachmentState.
Instance a VkAttachmentReference.
2738 {
2740
2744 VkAttachmentDescription attachmentDescription{};
2745 attachmentDescription.format =
m_Renderer->
m_Device->GetSwapChainSupport().format.format;
2746 attachmentDescription.samples = VK_SAMPLE_COUNT_1_BIT;
2747 attachmentDescription.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
2748 attachmentDescription.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
2749 attachmentDescription.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
2750 attachmentDescription.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
2751 attachmentDescription.initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
2752 attachmentDescription.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
2753
2758 func(attachmentDescription);
2759
2763 VkClearValue clearValue{};
2764 clearValue.color = { 0.0f, 0.0f, 0.0f, 1.0f };
2765
2769 VkPipelineColorBlendAttachmentState colorBlend{};
2770 colorBlend.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
2771 VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
2772 colorBlend.blendEnable = VK_FALSE;
2773 colorBlend.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
2774 colorBlend.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
2775 colorBlend.colorBlendOp = VK_BLEND_OP_ADD;
2776 colorBlend.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
2777 colorBlend.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
2778 colorBlend.alphaBlendOp = VK_BLEND_OP_ADD;
2779
2780 const uint32_t index =
m_Renderer->
m_Pass->AddAttachment(
"SwapChainImage", attachmentDescription, 1, clearValue);
2781
2785 VkAttachmentReference attachmentRef{};
2786 attachmentRef.attachment = index;
2787 attachmentRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
2788
2790
2791 return *this;
2792 }
#define SPICES_PROFILE_ZONE
std::shared_ptr< RendererSubPass > m_HandledRendererSubPass
Handled Sub pass.
Renderer * m_Renderer
Specific Renderer pointer. Passed while this class instanced.
std::shared_ptr< RendererPass > m_Pass
RendererPass.
std::shared_ptr< VulkanDevice > m_Device
VulkanDevice , Passed by instanced.