mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-13 22:11:45 -04:00
Fix ObjectDeleter arguments for NoParent cases. (#192)
This commit is contained in:
parent
8dbe1fa9d4
commit
7e2c734a9a
@ -3509,8 +3509,9 @@ void VulkanHppGenerator::writeFunctionBodyEnhancedReturnResultValue(std::ostream
|
|||||||
assert(ddit != m_deleters.end() && ddit->second.pool.empty());
|
assert(ddit != m_deleters.end() && ddit->second.pool.empty());
|
||||||
|
|
||||||
// special handling for "createDevice", as Device is created from PhysicalDevice, but destroyed on its own
|
// special handling for "createDevice", as Device is created from PhysicalDevice, but destroyed on its own
|
||||||
|
bool noParent = commandData.className.empty() || (commandData.fullName == "createDevice");
|
||||||
os << std::endl
|
os << std::endl
|
||||||
<< indentation << ((commandData.fullName == "allocateMemory") ? " ObjectFree<" : " ObjectDestroy<") << ((commandData.className.empty() || (commandData.fullName == "createDevice")) ? "NoParent" : commandData.className) << "> deleter( " << (commandData.className.empty() ? "" : "*this, ") << "allocator );" << std::endl;
|
<< indentation << ((commandData.fullName == "allocateMemory") ? " ObjectFree<" : " ObjectDestroy<") << (noParent ? "NoParent" : commandData.className) << "> deleter( " << (noParent ? "" : "*this, ") << "allocator );" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the return type is "Result" or there is at least one success code, create the Result/Value construct to return
|
// if the return type is "Result" or there is at least one success code, create the Result/Value construct to return
|
||||||
|
@ -33079,7 +33079,7 @@ public:
|
|||||||
Device device;
|
Device device;
|
||||||
Result result = static_cast<Result>( d.vkCreateDevice( m_physicalDevice, reinterpret_cast<const VkDeviceCreateInfo*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator ) ), reinterpret_cast<VkDevice*>( &device ) ) );
|
Result result = static_cast<Result>( d.vkCreateDevice( m_physicalDevice, reinterpret_cast<const VkDeviceCreateInfo*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator ) ), reinterpret_cast<VkDevice*>( &device ) ) );
|
||||||
|
|
||||||
ObjectDestroy<NoParent> deleter( *this, allocator );
|
ObjectDestroy<NoParent> deleter( allocator );
|
||||||
return createResultValue( result, device, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::createDeviceUnique", deleter );
|
return createResultValue( result, device, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::createDeviceUnique", deleter );
|
||||||
}
|
}
|
||||||
#endif /*VULKAN_HPP_NO_SMART_HANDLE*/
|
#endif /*VULKAN_HPP_NO_SMART_HANDLE*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user