Rewrap enumerated physical devices every time. Refs #234

This commit is contained in:
baldurk
2016-04-06 20:18:36 +02:00
parent ed400cbed0
commit 840338140d
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -162,6 +162,10 @@ struct WrappedVkDispRes : public WrappedVkRes
WrappedVkDispRes(VkCommandBuffer obj, ResourceId objId) : table(0), real((void *)obj), id(objId), record(NULL), core(NULL)
{ loaderTable = *(uintptr_t*)obj; }
template<typename realtype>
void RewrapObject(realtype obj)
{ real = (void *)obj; loaderTable = *(uintptr_t*)obj; }
// preserve dispatch table pointer in dispatchable objects
uintptr_t loaderTable, table;
RealVkRes real;
@@ -376,6 +376,7 @@ VkResult WrappedVulkan::vkEnumeratePhysicalDevices(
// return the wrapped object to the user and do nothing else
if(m_PhysicalDevices[i] != VK_NULL_HANDLE)
{
GetWrapped(m_PhysicalDevices[i])->RewrapObject(devices[i]);
devices[i] = m_PhysicalDevices[i];
}
else