diff options
Diffstat (limited to 'engine/xe_render_system.hpp')
-rw-r--r-- | engine/xe_render_system.hpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/engine/xe_render_system.hpp b/engine/xe_render_system.hpp new file mode 100644 index 0000000..42079df --- /dev/null +++ b/engine/xe_render_system.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include <vulkan/vulkan.h> +#include "xe_device.hpp" +#include "xe_pipeline.hpp" +#include "xe_frame_info.hpp" +#include "xe_game_object.hpp" + +#include <memory> + +namespace xe { + +template<typename P, typename U> +class XeRenderSystem { + public: + + struct XeData{}; + + XeRenderSystem( + XeDevice &device, + XeRenderer &renderer, + std::unique_ptr<XeDescriptorPool> &xeDescriptorPool, + std::unique_ptr<XeDescriptorSetLayout> &xeDescriptorSetLayout, + std::string vert, + std::string frag, + uint32_t pushCunstantDataSize, + uint32_t uniformBufferDataSize); + + ~XeRenderSystem(); + + XeRenderSystem(const XeRenderSystem &) = delete; + XeRenderSystem operator=(const XeRenderSystem &) = delete; + + void renderGameObjects(XeFrameInfo &frameInfo, std::vector<XeGameObject> &gameObjects, XeRenderSystem::XeData pushConstantData); + + private: + void createUniformBuffers(std::unique_ptr<XeDescriptorPool> &xeDescriptorPool, std::unique_ptr<XeDescriptorSetLayout> &xeDescriptorSetLayout, uint32_t uniformBufferDataSize); + void createPipelineLayout(std::unique_ptr<XeDescriptorSetLayout> &xeDescriptorSetLayout, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize); + void createPipeline(VkRenderPass renderPass, std::string vert, std::string frag); + + XeDevice& xeDevice; + + std::unique_ptr<XePipeline> xePipeline; + std::vector<std::unique_ptr<XeBuffer>> uboBuffers; + std::vector<VkDescriptorSet> descriptorSets; + + VkPipelineLayout pipelineLayout; + +}; + +}
\ No newline at end of file |