Add memory creation info

This commit is contained in:
baldurk
2015-10-29 16:44:46 +01:00
parent a87587e91f
commit 97527d273d
3 changed files with 17 additions and 0 deletions
+5
View File
@@ -262,6 +262,11 @@ void VulkanCreationInfo::Framebuffer::Init(VulkanResourceManager *resourceMan, c
attachments[i].view = resourceMan->GetNonDispWrapper(pCreateInfo->pAttachments[i])->id;
}
void VulkanCreationInfo::Memory::Init(VulkanResourceManager *resourceMan, const VkMemoryAllocInfo* pAllocInfo)
{
size = pAllocInfo->allocationSize;
}
void VulkanCreationInfo::Buffer::Init(VulkanResourceManager *resourceMan, const VkBufferCreateInfo* pCreateInfo)
{
size = pCreateInfo->size;
+8
View File
@@ -188,6 +188,14 @@ struct VulkanCreationInfo
};
map<ResourceId, Framebuffer> m_Framebuffer;
struct Memory
{
void Init(VulkanResourceManager *resourceMan, const VkMemoryAllocInfo* pAllocInfo);
uint64_t size;
};
map<ResourceId, Memory> m_Memory;
struct Buffer
{
void Init(VulkanResourceManager *resourceMan, const VkBufferCreateInfo* pCreateInfo);
@@ -54,6 +54,8 @@ bool WrappedVulkan::Serialise_vkAllocMemory(
{
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), mem);
GetResourceManager()->AddLiveResource(id, mem);
m_CreationInfo.m_Memory[live].Init(GetResourceManager(), &info);
}
}
@@ -97,6 +99,8 @@ VkResult WrappedVulkan::vkAllocMemory(
else
{
GetResourceManager()->AddLiveResource(id, *pMem);
m_CreationInfo.m_Memory[id].Init(GetResourceManager(), pAllocInfo);
}
}