68 std::array<vk::PipelineShaderStageCreateInfo, 2> shaderStage = {
74 vk::PipelineVertexInputStateCreateInfo vertexCreateInfo;
77 vk::PipelineInputAssemblyStateCreateInfo inputAssemblyCreateInfo(vk::PipelineInputAssemblyStateCreateFlags(),
78 vk::PrimitiveTopology::eTriangleList, VK_FALSE);
81 vk::Viewport viewport(0.0f, 0.0f,
static_cast<float>(
Core::swapchain.extent.width),
84 vk::PipelineViewportStateCreateInfo viewportCreateInfo(vk::PipelineViewportStateCreateFlags(),
85 1, &viewport, 1, &scissors);
88 vk::PipelineRasterizationStateCreateInfo rasterizerCreateInfo;
89 rasterizerCreateInfo.polygonMode = vk::PolygonMode::eFill;
90 rasterizerCreateInfo.cullMode = vk::CullModeFlagBits::eBack;
91 rasterizerCreateInfo.lineWidth = 1.0f;
92 rasterizerCreateInfo.frontFace = vk::FrontFace::eClockwise;
95 vk::PipelineMultisampleStateCreateInfo multisamplingCreateInfo;
96 multisamplingCreateInfo.minSampleShading = 1.0f;
99 vk::PipelineColorBlendAttachmentState attachmentState(VK_TRUE, vk::BlendFactor::eSrcAlpha,
100 vk::BlendFactor::eOneMinusSrcAlpha, vk::BlendOp::eAdd, vk::BlendFactor::eOne,
101 vk::BlendFactor::eZero, vk::BlendOp::eAdd, vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG |
102 vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA);
104 vk::PipelineColorBlendStateCreateInfo colorBlendingCreateInfo(vk::PipelineColorBlendStateCreateFlags(),
105 VK_FALSE, vk::LogicOp::eCopy, 1, &attachmentState);
108 #if defined(KALE_IOS) || defined(KALE_ANDROID)
109 std::vector<vk::DynamicState> dynamicStates;
111 std::vector<vk::DynamicState> dynamicStates = {vk::DynamicState::eViewport};
113 vk::PipelineDynamicStateCreateInfo dynamicCreateInfo(vk::PipelineDynamicStateCreateFlags(),
114 static_cast<uint32_t
>(dynamicStates.size()), dynamicStates.data());
120 vk::GraphicsPipelineCreateInfo createInfo(vk::PipelineCreateFlags(), 2, shaderStage.data(), &vertexCreateInfo,
121 &inputAssemblyCreateInfo,
nullptr, &viewportCreateInfo, &rasterizerCreateInfo, &multisamplingCreateInfo,
122 nullptr, &colorBlendingCreateInfo, &dynamicCreateInfo,
layout.get(), renderer.
renderPass.get());