Changeset 0ae182f in opengl-game


Ignore:
Timestamp:
Nov 11, 2019, 2:19:32 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
5a23277
Parents:
1f25a71
Message:

In vulkangame, finish implementing recreateSwapChain()

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • VulkanGame.vcxproj

    r1f25a71 r0ae182f  
    159159  </ItemGroup>
    160160  <ItemGroup>
     161    <None Include="assets\laser.xcf" />
    161162    <None Include="shaders\overlay.frag" />
    162163    <None Include="shaders\overlay.vert" />
     
    164165    <None Include="shaders\scene.vert" />
    165166  </ItemGroup>
     167  <ItemGroup>
     168    <Image Include="assets\images\spaceship.bmp" />
     169  </ItemGroup>
     170  <ItemGroup>
     171    <Font Include="assets\fonts\lazy.ttf" />
     172  </ItemGroup>
    166173  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
    167174  <ImportGroup Label="ExtensionTargets">
  • graphics-pipeline_vulkan.cpp

    r1f25a71 r0ae182f  
    2727
    2828GraphicsPipeline_Vulkan::~GraphicsPipeline_Vulkan() {
     29}
     30
     31void GraphicsPipeline_Vulkan::updateRenderPass(VkRenderPass renderPass) {
     32   this->renderPass = renderPass;
    2933}
    3034
  • graphics-pipeline_vulkan.hpp

    r1f25a71 r0ae182f  
    2323         Viewport viewport, int vertexSize);
    2424      ~GraphicsPipeline_Vulkan();
     25
     26      void updateRenderPass(VkRenderPass renderPass);
    2527
    2628      template<class VertexType, class IndexType>
  • vulkan-game.cpp

    r1f25a71 r0ae182f  
    7474}
    7575
    76 // TODO: Make some more initi functions, or call this initUI if the
     76// TODO: Make some more init functions, or call this initUI if the
    7777// amount of things initialized here keeps growing
    7878bool VulkanGame::initWindow(int width, int height, unsigned char guiFlags) {
     
    252252   graphicsPipelines.back().createDescriptorPool(swapChainImages);
    253253   graphicsPipelines.back().createDescriptorSets(swapChainImages);
    254 
    255    // TODO: Creating the descriptor pool and descriptor sets might need to be redone when the
    256    // swap chain is recreated
    257254
    258255   cout << "Created " << graphicsPipelines.size() << " graphics pipelines" << endl;
     
    958955   vkDeviceWaitIdle(device);
    959956
    960    //cleanupSwapChain();
     957   cleanupSwapChain();
     958
     959   createSwapChain();
     960   createImageViews();
     961   createRenderPass();
     962
     963   VulkanUtils::createDepthImage(device, physicalDevice, commandPool, findDepthFormat(), swapChainExtent,
     964      depthImage, graphicsQueue);
     965   createFramebuffers();
     966   createUniformBuffers();
     967
     968   graphicsPipelines[0].updateRenderPass(renderPass);
     969   graphicsPipelines[0].createPipeline("shaders/scene-vert.spv", "shaders/scene-frag.spv");
     970   graphicsPipelines[0].createDescriptorPool(swapChainImages);
     971   graphicsPipelines[0].createDescriptorSets(swapChainImages);
     972
     973   graphicsPipelines[1].updateRenderPass(renderPass);
     974   graphicsPipelines[1].createPipeline("shaders/overlay-vert.spv", "shaders/overlay-frag.spv");
     975   graphicsPipelines[1].createDescriptorPool(swapChainImages);
     976   graphicsPipelines[1].createDescriptorSets(swapChainImages);
     977
     978   createCommandBuffers();
    961979}
    962980
  • vulkan-ref.cpp

    r1f25a71 r0ae182f  
    18941894
    18951895         vkDeviceWaitIdle(device);
    1896 /*** END OF REFACTORED CODE ***/
    18971896
    18981897         cleanupSwapChain();
     
    19011900         createImageViews();
    19021901         createRenderPass();
    1903 
    19041902         createBufferResources();
    1905 /*** START OF REFACTORED CODE ***/
    19061903      }
    19071904
Note: See TracChangeset for help on using the changeset viewer.