Changeset 771b33a in opengl-game for vulkan-game.cpp


Ignore:
Timestamp:
Oct 4, 2019, 8:39:46 PM (6 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
b794178
Parents:
0b1b52d
Message:

In openglgame, port over some more of the pipeline creation code and the functionality to specify and initialize varying attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r0b1b52d r771b33a  
    88#include "logger.hpp"
    99
     10#include "utils.hpp"
    1011#include "vulkan-utils.hpp"
    1112
     
    106107   createCommandPool();
    107108
    108    graphicsPipelines.push_back(GraphicsPipeline_Vulkan(device));
     109   graphicsPipelines.push_back(GraphicsPipeline_Vulkan(device, viewport, sizeof(Vertex)));
     110
     111   graphicsPipelines.back().addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&Vertex::pos));
     112   graphicsPipelines.back().addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&Vertex::color));
     113   graphicsPipelines.back().addAttribute(VK_FORMAT_R32G32_SFLOAT, offset_of(&Vertex::texCoord));
     114
    109115   graphicsPipelines.back().createPipeline("shaders/scene-vert.spv", "shaders/scene-frag.spv");
    110116
    111    graphicsPipelines.push_back(GraphicsPipeline_Vulkan(device));
     117   graphicsPipelines.push_back(GraphicsPipeline_Vulkan(device, viewport, sizeof(OverlayVertex)));
     118
     119   graphicsPipelines.back().addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&OverlayVertex::pos));
     120   graphicsPipelines.back().addAttribute(VK_FORMAT_R32G32_SFLOAT, offset_of(&OverlayVertex::texCoord));
     121
    112122   graphicsPipelines.back().createPipeline("shaders/overlay-vert.spv", "shaders/overlay-frag.spv");
    113123
     
    427437
    428438   swapChainImageFormat = surfaceFormat.format;
    429    swapChainExtent = extent;
     439   viewport = { 0, 0, (int)extent.width, (int)extent.height };
    430440}
    431441
Note: See TracChangeset for help on using the changeset viewer.