5 #include <ThirdParty/Vulkan/Include/vulkan/vulkan.h> 6 #include <ThirdParty/assimp/include/assimp/Importer.hpp> 7 #include <ThirdParty/assimp/include/assimp/scene.h> 16 #include <ThirdParty/EASTL-master/include/EASTL/map.h> 17 #include <ThirdParty/EASTL-master/include/EASTL/tuple.h> 31 static void InitMeshes(VulkanRenderer* renderer, VulkanLogicalDevice* device, VulkanDescriptorPool* descriptorPool, VkCommandPool commandPool);
36 void SetUpMesh()
override;
42 VkBuffer GetVertexBuffer()
const;
48 VkBuffer GetIndexBuffer()
const;
54 VkBuffer GetShadowIndexBuffer()
const;
60 uint32_t GetShadowIndexCount()
const;
66 uint32_t GetIndexCount();
72 bool IsAnimated()
const;
81 VkDescriptorSet CreateBoneOffsetDescriptorSet(
size_t threadID,
size_t pipelineID,
size_t set, VkDescriptorSetLayout layout);
90 VkDescriptorSet GetBoneOffsetDescriptorSet(
size_t threadID,
size_t pipelineID,
size_t set);
95 friend class ResourceManager;
97 VulkanMesh() =
delete;
98 VulkanMesh(aiMesh* mesh, eastl::shared_ptr<Skeleton> skeleton, eastl::vector<Vertex> vertices, eastl::vector<unsigned> indices);
99 VulkanMesh(VulkanMesh
const &other) =
default;
109 Edge(uint32_t index1, uint32_t index2) {
110 if (index1 > index2) {
120 bool operator<(
const Edge& right)
const {
121 return eastl::tie(indices[0], indices[1]) <
122 eastl::tie(right.indices[0], right.indices[1]);
130 bool operator==(
const Face& other)
const {
131 return (indices[0] == other.indices[0] &&
132 indices[1] == other.indices[1] &&
133 indices[2] == other.indices[2]);
136 uint32_t FindOpposingIndex(Edge edge) {
137 for (
int i = 0; i < 3; ++i) {
138 if (indices[i] != edge.indices[0] && indices[i] != edge.indices[1])
145 eastl::shared_ptr<Skeleton> skeleton;
147 eastl::vector<glm::mat4> boneOffsets;
149 eastl::unique_ptr<VulkanBuffer> vertexBuffer;
150 eastl::unique_ptr<VulkanBuffer> indexBuffer;
151 eastl::unique_ptr<VulkanBuffer> offsetBuffer;
153 eastl::unique_ptr<VulkanBuffer> shadowIndexBuffer;
155 eastl::vector<eastl::vector<eastl::vector<VkDescriptorSet>>> offsetDescriptorSets;
157 eastl::shared_ptr<VulkanTexture> diffuseMissing;
159 const aiScene* scene;
162 static VulkanRenderer* renderer;
163 static VulkanLogicalDevice* device;
164 static VkCommandPool commandPool;
165 static VmaAllocator allocator;
166 static VulkanDescriptorPool* descriptorPool;
170 uint32_t shadowIndicesCount;