Vulkan resource cleanup
This commit is contained in:
parent
2517a2b82e
commit
683515d12b
1 changed files with 2 additions and 7 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue