Changeset 52a02e6 in opengl-game for graphics-pipeline_vulkan.hpp


Ignore:
Timestamp:
Apr 26, 2020, 6:08:05 PM (4 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master
Children:
4a9416a
Parents:
73a10ca
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (04/26/20 17:55:49)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (04/26/20 18:08:05)
Message:

Add a primitive topology parameter to the GraphicsPipeline_Vulkan constructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_vulkan.hpp

    r73a10ca r52a02e6  
    4949      // if it will never change, just pass it in the constructor and save it
    5050      // If it does change, I could add an updateSwapchainImageCount() function
    51       GraphicsPipeline_Vulkan(VkPhysicalDevice physicalDevice, VkDevice device, VkRenderPass renderPass,
    52          Viewport viewport, vector<VkImage>& swapChainImages,
     51      GraphicsPipeline_Vulkan(VkPrimitiveTopology topology, VkPhysicalDevice physicalDevice, VkDevice device,
     52         VkRenderPass renderPass, Viewport viewport, vector<VkImage>& swapChainImages,
    5353         size_t vertexCapacity, size_t indexCapacity, size_t objectCapacity);
    5454      ~GraphicsPipeline_Vulkan();
     
    8686   
    8787   private:
     88      VkPrimitiveTopology topology;
    8889      VkPhysicalDevice physicalDevice;
    8990      VkDevice device;
     
    136137template<class VertexType, class SSBOType>
    137138GraphicsPipeline_Vulkan<VertexType, SSBOType>::GraphicsPipeline_Vulkan(
    138       VkPhysicalDevice physicalDevice, VkDevice device,
     139      VkPrimitiveTopology topology, VkPhysicalDevice physicalDevice, VkDevice device,
    139140      VkRenderPass renderPass, Viewport viewport, vector<VkImage>& swapChainImages,
    140141      size_t vertexCapacity, size_t indexCapacity, size_t objectCapacity) {
     142   this->topology = topology;
    141143   this->physicalDevice = physicalDevice;
    142144   this->device = device;
     
    274276   VkPipelineInputAssemblyStateCreateInfo inputAssembly = {};
    275277   inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
    276    inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
     278   inputAssembly.topology = this->topology;
    277279   inputAssembly.primitiveRestartEnable = VK_FALSE;
    278280
Note: See TracChangeset for help on using the changeset viewer.