diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-19 12:54:23 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-19 12:54:23 -0400 |
commit | 430a008ab34a2d8d381108c4b697894dc7d691c0 (patch) | |
tree | d7a5e7466f977771f4f22782f006977d2b8fff5d /engine/xe_engine.cpp | |
parent | start refactoring, doesnt compile (diff) | |
download | minecraftvulkan-430a008ab34a2d8d381108c4b697894dc7d691c0.tar.gz minecraftvulkan-430a008ab34a2d8d381108c4b697894dc7d691c0.tar.bz2 minecraftvulkan-430a008ab34a2d8d381108c4b697894dc7d691c0.zip |
more recatoring, doesnt compile
Diffstat (limited to 'engine/xe_engine.cpp')
-rw-r--r-- | engine/xe_engine.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
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<XeRenderSystem> XeEngine::createRenderSystem(const std::string &vert, const std::string &frag, typename pushCunstant, typename uniformBuffer) { + return std::make_unique<XeRenderSystem>( + xeDevice, + xeRenderer, + xeDescriptorPool, + xeDescriptorSetLayout, + vert, + frag, + pushCunstantDataSize, + uniformBufferDataSize + ); } }
\ No newline at end of file |