Changeset 7d2b0b9 in opengl-game


Ignore:
Timestamp:
Oct 3, 2019, 3:44:55 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
3de31cf
Parents:
4d84c72
Message:

Add and begin implementing a GraphicsPipeline class to hold info for the Vulkan graphics pipeline

Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • VulkanGame.vcxproj

    r4d84c72 r7d2b0b9  
    135135    <ClCompile Include="FileStackWalker.cpp" />
    136136    <ClCompile Include="game-gui-sdl.cpp" />
     137    <ClCompile Include="graphics-pipeline_vulkan.cpp" />
    137138    <ClCompile Include="logger.cpp" />
    138139    <ClCompile Include="main-vulkan.cpp" />
     
    148149    <ClInclude Include="game-gui-sdl.hpp" />
    149150    <ClInclude Include="game-gui.hpp" />
     151    <ClInclude Include="graphics-pipeline.hpp" />
     152    <ClInclude Include="graphics-pipeline_vulkan.hpp" />
    150153    <ClInclude Include="logger.hpp" />
    151154    <ClInclude Include="StackWalker.h" />
  • vulkan-game.cpp

    r4d84c72 r7d2b0b9  
    105105   createRenderPass();
    106106   createCommandPool();
     107
     108   graphicsPipelines.push_back(GraphicsPipeline_Vulkan(device));
     109   graphicsPipelines.back().createPipeline("shaders/scene-vert.spv", "shaders/scene-frag.spv");
     110
     111   graphicsPipelines.push_back(GraphicsPipeline_Vulkan(device));
     112   graphicsPipelines.back().createPipeline("shaders/overlay-vert.spv", "shaders/overlay-frag.spv");
     113
     114   cout << "Created " << graphicsPipelines.size() << " graphics pipelines" << endl;
    107115}
    108116
  • vulkan-game.hpp

    r4d84c72 r7d2b0b9  
    33
    44#include "game-gui-sdl.hpp"
     5#include "graphics-pipeline_vulkan.hpp"
    56
    67#ifdef NDEBUG
     
    1920   private:
    2021      GameGui* gui;
     22
     23      vector<GraphicsPipeline_Vulkan> graphicsPipelines;
    2124
    2225      SDL_version sdlVersion;
  • vulkan-ref.cpp

    r4d84c72 r7d2b0b9  
    863863
    864864      void createGraphicsPipeline(string vertShaderFile, string fragShaderFile, GraphicsPipelineInfo& info) {
    865          auto vertShaderCode = readFile(vertShaderFile);
    866          auto fragShaderCode = readFile(fragShaderFile);
     865/*** START OF REFACTORED CODE ***/
     866         vector<char> vertShaderCode = readFile(vertShaderFile);
     867         vector<char> fragShaderCode = readFile(fragShaderFile);
    867868
    868869         VkShaderModule vertShaderModule = createShaderModule(vertShaderCode);
     
    885886         VkPipelineVertexInputStateCreateInfo vertexInputInfo = {};
    886887         vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
     888/*** END OF REFACTORED CODE ***/
    887889
    888890         vertexInputInfo.vertexBindingDescriptionCount = 1;
     
    995997         }
    996998
     999/*** START OF REFACTORED CODE ***/
    9971000         vkDestroyShaderModule(device, vertShaderModule, nullptr);
    9981001         vkDestroyShaderModule(device, fragShaderModule, nullptr);
     1002/*** END OF REFACTORED CODE ***/
    9991003      }
    10001004
Note: See TracChangeset for help on using the changeset viewer.