5 #include <ThirdParty/Vulkan/Include/vulkan/vulkan.h> 14 #include <ThirdParty/glm/glm/glm.hpp> 15 #include <ThirdParty/EASTL-master/include/EASTL/map.h> 22 class VulkanStaticMeshRenderer
25 VulkanStaticMeshRenderer(VulkanRenderer* renderer, VulkanLogicalDevice* device, VulkanDescriptorPool* descriptorPool);
26 ~VulkanStaticMeshRenderer();
28 void StartRender(glm::mat4 view, glm::mat4 projection);
30 void RenderMesh(
const glm::mat4x4& modelMatrix, eastl::shared_ptr<VulkanMesh> mesh,
31 eastl::shared_ptr<VulkanMaterial> material,
const glm::vec4& mainColor = glm::vec4(1.f, 1.f, 1.f, 1.f));
33 void FinishRender(
size_t threadID, VkCommandPool commandPool, VkCommandBuffer buffer);
35 void RenderShadows(
size_t threadID, VkCommandPool commandPool, VkCommandBuffer buffer, uint32_t lightOffset);
40 const int MAX_INSTANCE_COUNT = 1024;
44 eastl::unique_ptr<VulkanPipeline> staticMeshPipeline_;
45 eastl::unique_ptr<VulkanPipeline> shadowPipeline_;
47 eastl::unique_ptr<VulkanBuffer> uniformBuffer_;
56 eastl::shared_ptr<VulkanTexture> defaultTexture_;
58 eastl::vector<VkDescriptorSet> uboDescriptors_;
66 eastl::vector<glm::mat4> transforms;
67 eastl::unique_ptr<VulkanBuffer> transformBuffer;
68 VkDescriptorSet materialDescriptor;
69 eastl::shared_ptr<VulkanMaterial> material;
73 eastl::multimap<eastl::shared_ptr<VulkanMesh>, MeshData*> meshInstances_;
75 VulkanRenderer* renderer_;
76 VulkanLogicalDevice* device_;
77 VulkanDescriptorPool* descriptorPool_;
79 VmaAllocator allocator_;
81 VkCommandPool commandPool_;
83 VkCommandBuffer commandBuffer_;
88 #endif // USING_VULKAN