diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-20 22:02:58 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-20 22:02:58 -0400 |
commit | 249f6c9fa384e9e3265cafb1357e502ea7db72f7 (patch) | |
tree | 0c80d9a375453e9178dd5d45807302b00f57bd59 /engine/xe_render_system.hpp | |
parent | destroy pipline layout (diff) | |
download | minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.tar.gz minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.tar.bz2 minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.zip |
texture loading
Diffstat (limited to '')
-rw-r--r-- | engine/xe_render_system.hpp | 25 |
1 files changed, 20 insertions, 5 deletions
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 <memory> @@ -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<std::unique_ptr<XeBuffer>> uboBuffers; std::vector<VkDescriptorSet> descriptorSets; + VkSampler textureSampler; + VkImageView textureImageView; + VkPipelineLayout pipelineLayout; + std::unique_ptr<XeDescriptorSetLayout> xeDescriptorSetLayout; }; |