From 430a008ab34a2d8d381108c4b697894dc7d691c0 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 19 Sep 2022 12:54:23 -0400 Subject: more recatoring, doesnt compile --- engine/xe_engine.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'engine/xe_engine.cpp') diff --git a/engine/xe_engine.cpp b/engine/xe_engine.cpp index 8d2655a..ff9c95b 100644 --- a/engine/xe_engine.cpp +++ b/engine/xe_engine.cpp @@ -4,14 +4,35 @@ namespace xe { XeEngine::XeEngine(int width, int height, std::string name) - : xeWindow{width, height, name}, xeDevice{xeWindow}, xeRenderer{xeWindow, xeDevice} {}; + : xeWindow{width, height, name}, xeDevice{xeWindow}, xeRenderer{xeWindow, xeDevice} { + loadDescriptors(); + }; -void XeEngine::loadDescriptorPool() { +XeEngine::~XeEngine() {}; + +void XeEngine::loadDescriptors() { xeDescriptorPool = XeDescriptorPool::Builder(xeDevice) .setMaxSets(XeSwapChain::MAX_FRAMES_IN_FLIGHT) .addPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, XeSwapChain::MAX_FRAMES_IN_FLIGHT) .addPoolSize(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, XeSwapChain::MAX_FRAMES_IN_FLIGHT) .build(); + + xeDescriptorSetLayout = XeDescriptorSetLayout::Builder(xeDevice) + .addBinding(0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT) + .build(); +} + +std::unique_ptr XeEngine::createRenderSystem(const std::string &vert, const std::string &frag, typename pushCunstant, typename uniformBuffer) { + return std::make_unique( + xeDevice, + xeRenderer, + xeDescriptorPool, + xeDescriptorSetLayout, + vert, + frag, + pushCunstantDataSize, + uniformBufferDataSize + ); } } \ No newline at end of file -- cgit v1.2.3-freya