Changeset fd70015 in opengl-game
- Timestamp:
- Jul 16, 2019, 3:59:55 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- ebeb3aa
- Parents:
- be34c9a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
rbe34c9a rfd70015 115 115 VkRenderPass renderPass; 116 116 VkPipelineLayout pipelineLayout; 117 VkPipeline graphicsPipeline; 117 118 118 119 // both SDL and GLFW create window functions return NULL on failure … … 680 681 if (vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout) != VK_SUCCESS) { 681 682 throw runtime_error("failed to create pipeline layout!"); 683 } 684 685 VkGraphicsPipelineCreateInfo pipelineInfo = {}; 686 pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; 687 pipelineInfo.stageCount = 2; 688 pipelineInfo.pStages = shaderStages; 689 pipelineInfo.pVertexInputState = &vertexInputInfo; 690 pipelineInfo.pInputAssemblyState = &inputAssembly; 691 pipelineInfo.pViewportState = &viewportState; 692 pipelineInfo.pRasterizationState = &rasterizer; 693 pipelineInfo.pMultisampleState = &multisampling; 694 pipelineInfo.pDepthStencilState = nullptr; 695 pipelineInfo.pColorBlendState = &colorBlending; 696 pipelineInfo.pDynamicState = nullptr; 697 pipelineInfo.layout = pipelineLayout; 698 pipelineInfo.renderPass = renderPass; 699 pipelineInfo.subpass = 0; 700 pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; 701 pipelineInfo.basePipelineIndex = -1; 702 703 if (vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS) { 704 throw runtime_error("failed to create graphics pipeline!"); 682 705 } 683 706 … … 727 750 728 751 void cleanup() { 752 vkDestroyPipeline(device, graphicsPipeline, nullptr); 729 753 vkDestroyPipelineLayout(device, pipelineLayout, nullptr); 730 754 vkDestroyRenderPass(device, renderPass, nullptr);
Note:
See TracChangeset
for help on using the changeset viewer.