Redesigning pipeline

This commit is contained in:
2026-02-20 11:30:18 +00:00
parent 38dd0e732c
commit 6d22df0c46
8 changed files with 533 additions and 10 deletions

View File

@@ -3,6 +3,10 @@
#include "cve_window.hpp"
#include "cve_pipeline.hpp"
#include "cve_device.hpp"
#include "cve_swap_chain.hpp"
#include <memory>
#include <vector>
namespace cve {
class FirstApp {
@@ -10,11 +14,24 @@ namespace cve {
static constexpr int WIDTH = 800;
static constexpr int HEIGHT = 600;
FirstApp();
~FirstApp();
FirstApp(const FirstApp &) = delete;
FirstApp &operator=(const FirstApp &) = delete;
void run();
private:
void createPipelineLayout();
void createPipeline();
void createCommandBuffers();
void drawFrame();
CveWindow cveWindow{WIDTH, HEIGHT, "Hello Vulkan!"};
CveDevice cveDevice{cveWindow};
CvePipeline cvePipeline{cveDevice, "shaders/simple_shader.vert.spv",
"shaders/simple_shader.frag.spv", CvePipeline::defaultPipelineConfigInfo(WIDTH, HEIGHT)};
CveSwapChain cveSwapChain{cveDevice, cveWindow.getExtent()};
std::unique_ptr<CvePipeline> cvePipeline;
VkPipelineLayout pipelineLayout;
std::vector<VkCommandBuffer> commandBuffers;
};
}