From 249f6c9fa384e9e3265cafb1357e502ea7db72f7 Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Tue, 20 Sep 2022 22:02:58 -0400 Subject: texture loading --- engine/xe_render_system.hpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'engine/xe_render_system.hpp') diff --git a/engine/xe_render_system.hpp b/engine/xe_render_system.hpp index fa56fdd..fbf10fc 100644 --- a/engine/xe_render_system.hpp +++ b/engine/xe_render_system.hpp @@ -7,6 +7,7 @@ #include "xe_descriptors.hpp" #include "xe_renderer.hpp" #include "xe_engine.hpp" +#include "xe_image.hpp" #include @@ -20,7 +21,8 @@ class XeRenderSystem { std::string vert, std::string frag, uint32_t pushCunstantDataSize, - uint32_t uniformBufferDataSize + uint32_t uniformBufferDataSize, + XeImage *image ); ~XeRenderSystem(); @@ -28,20 +30,29 @@ class XeRenderSystem { XeRenderSystem(const XeRenderSystem &) = delete; XeRenderSystem operator=(const XeRenderSystem &) = delete; - void loadPushConstant(void *pushConstantData, uint32_t pushConstantSize); - void loadUniformObject(void *uniformBufferData, uint32_t uniformBufferSize); + void start(); + void loadPushConstant(void *pushConstantData); + void loadUniformObject(void *uniformBufferData); + void loadTexture(XeImage *image); void render(XeGameObject &gameObject); void stop(); private: - void createUniformBuffers(XeDescriptorPool &xeDescriptorPool, XeDescriptorSetLayout &xeDescriptorSetLayout, uint32_t uniformBufferDataSize); - void createPipelineLayout(XeDescriptorSetLayout &xeDescriptorSetLayout, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize); + void createDescriptorSetLayout(); + void createUniformBuffers(); + void createTextureImageView(XeImage *image); + void createDescriptorSets(XeDescriptorPool &xeDescriptorPool); + void createPipelineLayout(); void createPipeline(VkRenderPass renderPass, std::string vert, std::string frag); bool boundPipeline{false}; bool boundDescriptor{false}; + uint32_t uniformBufferDataSize; + uint32_t pushCunstantDataSize; + bool textureSamplerBinding; + XeDevice& xeDevice; XeRenderer& xeRenderer; @@ -49,7 +60,11 @@ class XeRenderSystem { std::vector> uboBuffers; std::vector descriptorSets; + VkSampler textureSampler; + VkImageView textureImageView; + VkPipelineLayout pipelineLayout; + std::unique_ptr xeDescriptorSetLayout; }; -- cgit v1.2.3-freya