15 const VkPipelineVertexInputStateCreateInfo vertexInputCreateInfo{
16 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
26 const VkPipelineInputAssemblyStateCreateInfo inputAssemblyCreateInfo{
27 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
47 const VkPipelineDynamicStateCreateInfo dynamicStateCreateInfo{
48 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
51 static_cast<uint32_t
>(dynamicStates.size()),
56 const VkGraphicsPipelineCreateInfo createInfo{
57 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
62 &vertexInputCreateInfo,
63 &inputAssemblyCreateInfo,
70 &dynamicStateCreateInfo,
79 VkPipeline vkGraphicPipeline = VK_NULL_HANDLE;
80 VkResult result = vkCreateGraphicsPipelines(static_cast<VkDevice>(
_device),
_pipelineCache, 1, &createInfo,
nullptr, &vkGraphicPipeline);
83 *returnResult = result;
86 if (result != VK_SUCCESS) {
96 std::unique_ptr<API::GraphicsPipeline> graphicPipeline = std::make_unique<API::GraphicsPipeline>();
97 return build(*graphicPipeline, returnResult) ? std::move(graphicPipeline) :
nullptr;
VkPipelineCache _pipelineCache
VkPipelineRasterizationStateCreateInfo _rasterizationState
std::vector< VkRect2D > _scissors
std::set< VkDynamicState > _dynamicStates
const API::Device & _device
GraphicsPipeline(const API::Device &device)
std::vector< VkPipelineShaderStageCreateInfo > _shaderStages
std::vector< VkVertexInputAttributeDescription > _inputAttributes
std::vector< VkViewport > _viewports
bool build(API::GraphicsPipeline &graphicPipeline, VkResult *returnResult=nullptr)
VkPipelineMultisampleStateCreateInfo _multisampleState
bool _primitiveRestartEnable
API::RenderPass _renderPass
VkPipelineViewportStateCreateInfo _viewportState
VkPipelineColorBlendStateCreateInfo _colorBlendState
VkPrimitiveTopology _topology
std::vector< VkPipelineColorBlendAttachmentState > _colorBlendAttachments
std::vector< VkVertexInputBindingDescription > _inputBindings
VkPipelineDepthStencilStateCreateInfo _depthStencilState
API::PipelineLayout _pipelineLayout