diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-26 18:03:07 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-26 18:03:07 -0400 |
commit | 873ca38c0dc8966cd54a18dd74d40c709d83eb32 (patch) | |
tree | 0d49e34d566d23bb73f534294737e253613a2a01 /engine/xe_render_system.hpp | |
parent | undo nearest neighbor (diff) | |
download | minecraftvulkan-873ca38c0dc8966cd54a18dd74d40c709d83eb32.tar.gz minecraftvulkan-873ca38c0dc8966cd54a18dd74d40c709d83eb32.tar.bz2 minecraftvulkan-873ca38c0dc8966cd54a18dd74d40c709d83eb32.zip |
texture arrays
Diffstat (limited to 'engine/xe_render_system.hpp')
-rw-r--r-- | engine/xe_render_system.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engine/xe_render_system.hpp b/engine/xe_render_system.hpp index 045f6db..b82d6e7 100644 --- a/engine/xe_render_system.hpp +++ b/engine/xe_render_system.hpp @@ -54,19 +54,25 @@ class RenderSystem { return *this; } + Builder& addTextureArrayBinding(uint32_t binding, std::vector<Image*>& image) { + imageArrayBindings[binding] = image; + return *this; + } + Builder& setCulling(bool enabled) { cullingEnabled = enabled; return *this; } std::unique_ptr<RenderSystem> build() { - return std::make_unique<RenderSystem>(xeEngine, std::move(vert), std::move(frag), std::move(uniformBindings), std::move(imageBindings), std::move(pushCunstantDataSize), std::move(cullingEnabled), std::move(attributeDescptions), std::move(vertexSize)); + return std::make_unique<RenderSystem>(xeEngine, std::move(vert), std::move(frag), std::move(uniformBindings), std::move(imageBindings), std::move(imageArrayBindings), std::move(pushCunstantDataSize), std::move(cullingEnabled), std::move(attributeDescptions), std::move(vertexSize)); } private: std::map<uint32_t, uint32_t> uniformBindings{}; std::map<uint32_t, Image*> imageBindings{}; + std::map<uint32_t, std::vector<Image*>> imageArrayBindings{}; uint32_t pushCunstantDataSize{0}; std::vector<VkVertexInputAttributeDescription> attributeDescptions{}; @@ -86,6 +92,7 @@ class RenderSystem { std::string frag, std::map<uint32_t, uint32_t> uniformBindings, std::map<uint32_t, Image*> imageBindings, + std::map<uint32_t, std::vector<Image*>> imageArrayBindings, uint32_t pushCunstantDataSize, bool cullingEnabled, std::vector<VkVertexInputAttributeDescription> attributeDescptions, @@ -101,6 +108,7 @@ class RenderSystem { void loadPushConstant(void *pushConstantData); void loadUniformObject(uint32_t binding, void *uniformBufferData); void loadTexture(uint32_t binding, Image *image); + void loadTextureArray(uint32_t binding, std::vector<Image*> &images); void render(GameObject &gameObject); void stop(); @@ -123,6 +131,7 @@ class RenderSystem { std::map<uint32_t, std::vector<std::unique_ptr<Buffer>>> uboBuffers{}; std::map<uint32_t, uint32_t> uniformBindings; std::map<uint32_t, Image*> imageBindings; + std::map<uint32_t, std::vector<Image*>> imageArrayBindings{}; std::vector<VkDescriptorSet> descriptorSets; uint32_t pushCunstantDataSize; |