diff --git a/a.out b/a.out index c18378b..7eb2079 100755 Binary files a/a.out and b/a.out differ diff --git a/first_app.cpp b/first_app.cpp index 65e0cf1..de3a35c 100644 --- a/first_app.cpp +++ b/first_app.cpp @@ -1,6 +1,18 @@ #include "first_app.hpp" +#include + namespace cve { + FirstApp::FirstApp() { + createPipelineLayout(); + createPipeline(); + createCommandBuffers(); + } + + FirstApp::~FirstApp() { + vkDestroyPipelineLayout(cveDevice.device(), pipelineLayout, nullptr); + } + void FirstApp::run() { while (!cveWindow.shouldClose()) { glfwPollEvents(); @@ -13,5 +25,24 @@ namespace cve { pipelineLayoutInfo.pSetLayouts = nullptr; pipelineLayoutInfo.pushConstantRangeCount = 0; pipelineLayoutInfo.pPushConstantRanges = nullptr; + if (vkCreatePipelineLayout(cveDevice.device(), &pipelineLayoutInfo, nullptr, &pipelineLayout) != + VK_SUCCESS) { + throw std::runtime_error("Failed to create pipeline layout"); + } } + + void FirstApp::createPipeline() { + auto pipelineConfig = CvePipeline::defaultPipelineConfigInfo(cveSwapChain.width(), cveSwapChain.height()); + pipelineConfig.renderPass = cveSwapChain.getRenderPass(); + pipelineConfig.pipelineLayout = pipelineLayout; + cvePipeline = std::make_unique( + cveDevice, + "shaders/simple_shader.vert.spv", + "shaders/simple_shader.frag.spv", + pipelineConfig + ); + } + + void FirstApp::createCommandBuffers() {}; + void FirstApp::drawFrame() {}; }