Vulkan resource cleanup

This commit is contained in:
saschawillems 2016-04-02 12:52:25 +02:00
parent 2517a2b82e
commit 683515d12b

View file

@ -80,12 +80,6 @@ public:
glm::vec3 color; glm::vec3 color;
}; };
struct MeshBuffer {
vkMeshLoader::MeshBufferInfo vertices;
vkMeshLoader::MeshBufferInfo indices;
uint32_t indexCount;
};
struct ObjectData { struct ObjectData {
glm::mat4 model; glm::mat4 model;
glm::vec3 pos; glm::vec3 pos;
@ -97,7 +91,7 @@ public:
}; };
struct ThreadData { struct ThreadData {
MeshBuffer mesh; vkMeshLoader::MeshBuffer mesh;
VkCommandPool commandPool; VkCommandPool commandPool;
// One command buffer per render object // One command buffer per render object
std::vector<VkCommandBuffer> commandBuffer; std::vector<VkCommandBuffer> commandBuffer;
@ -154,6 +148,7 @@ public:
{ {
vkFreeCommandBuffers(device, thread.commandPool, thread.commandBuffer.size(), thread.commandBuffer.data()); vkFreeCommandBuffers(device, thread.commandPool, thread.commandBuffer.size(), thread.commandBuffer.data());
vkDestroyCommandPool(device, thread.commandPool, nullptr); vkDestroyCommandPool(device, thread.commandPool, nullptr);
vkMeshLoader::freeMeshBufferResources(device, &thread.mesh);
} }
} }