VulkanRenderer: Fix 32bits compilation
This commit is contained in:
@@ -48,6 +48,8 @@ namespace Nz
|
||||
inline VkVertexInputRate ToVulkan(VertexInputRate inputRate);
|
||||
|
||||
NAZARA_VULKANRENDERER_API std::string TranslateVulkanError(VkResult code);
|
||||
|
||||
template<typename T> UInt64 VulkanHandleToInteger(T handle);
|
||||
}
|
||||
|
||||
#include <Nazara/VulkanRenderer/Utils.inl>
|
||||
|
||||
@@ -497,6 +497,18 @@ namespace Nz
|
||||
NazaraError("Unhandled VertexInputRate 0x" + NumberToString(UnderlyingCast(inputRate), 16));
|
||||
return {};
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
UInt64 VulkanHandleToInteger(T handle)
|
||||
{
|
||||
if constexpr (std::is_pointer_v<T>)
|
||||
return static_cast<UInt64>(reinterpret_cast<std::uintptr_t>(handle));
|
||||
else
|
||||
{
|
||||
static_assert(std::is_integral_v<T>);
|
||||
return static_cast<UInt64>(handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/VulkanRenderer/DebugOff.hpp>
|
||||
|
||||
@@ -86,13 +86,7 @@ namespace Nz::Vk
|
||||
template<typename T>
|
||||
void DeviceObject<C, VkType, CreateInfo, ObjectType>::SetDebugName(T&& name)
|
||||
{
|
||||
UInt64 objectHandle;
|
||||
if constexpr (std::is_pointer_v<VkType>)
|
||||
objectHandle = static_cast<UInt64>(reinterpret_cast<std::uintptr_t>(m_handle));
|
||||
else
|
||||
objectHandle = static_cast<UInt64>(m_handle);
|
||||
|
||||
return m_device->SetDebugName(ObjectType, objectHandle, std::forward<T>(name));
|
||||
return m_device->SetDebugName(ObjectType, VulkanHandleToInteger(m_handle), std::forward<T>(name));
|
||||
}
|
||||
|
||||
template<typename C, typename VkType, typename CreateInfo, VkObjectType ObjectType>
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Nz
|
||||
|
||||
inline void Pipeline::SetDebugName(std::string_view name)
|
||||
{
|
||||
return m_device->SetDebugName(VK_OBJECT_TYPE_PIPELINE, static_cast<UInt64>(reinterpret_cast<std::uintptr_t>(m_handle)), name);
|
||||
return m_device->SetDebugName(VK_OBJECT_TYPE_PIPELINE, VulkanHandleToInteger(m_handle), name);
|
||||
}
|
||||
|
||||
inline Pipeline::operator VkPipeline() const
|
||||
|
||||
Reference in New Issue
Block a user