Changeset fd70015 in opengl-game


Ignore:
Timestamp:
Jul 16, 2019, 3:59:55 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
ebeb3aa
Parents:
be34c9a
Message:

Create the graphics pipeline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    rbe34c9a rfd70015  
    115115      VkRenderPass renderPass;
    116116      VkPipelineLayout pipelineLayout;
     117      VkPipeline graphicsPipeline;
    117118
    118119      // both SDL and GLFW create window functions return NULL on failure
     
    680681         if (vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout) != VK_SUCCESS) {
    681682            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!");
    682705         }
    683706
     
    727750
    728751      void cleanup() {
     752         vkDestroyPipeline(device, graphicsPipeline, nullptr);
    729753         vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
    730754         vkDestroyRenderPass(device, renderPass, nullptr);
Note: See TracChangeset for help on using the changeset viewer.