Pointer to mapped host memory for uniform data

This commit is contained in:
saschawillems 2016-04-17 11:23:56 +02:00
parent 884916e083
commit 3faee12381
2 changed files with 5 additions and 0 deletions

View file

@ -411,6 +411,10 @@ namespace vkTools
void destroyUniformData(VkDevice device, vkTools::UniformData *uniformData) void destroyUniformData(VkDevice device, vkTools::UniformData *uniformData)
{ {
if (uniformData->mapped != nullptr)
{
vkUnmapMemory(device, uniformData->memory);
}
vkDestroyBuffer(device, uniformData->buffer, nullptr); vkDestroyBuffer(device, uniformData->buffer, nullptr);
vkFreeMemory(device, uniformData->memory, nullptr); vkFreeMemory(device, uniformData->memory, nullptr);
} }

View file

@ -100,6 +100,7 @@ namespace vkTools
VkDeviceMemory memory; VkDeviceMemory memory;
VkDescriptorBufferInfo descriptor; VkDescriptorBufferInfo descriptor;
uint32_t allocSize; uint32_t allocSize;
void* mapped = nullptr;
}; };
// Destroy (and free) Vulkan resources used by a uniform data structure // Destroy (and free) Vulkan resources used by a uniform data structure