mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Fix issue with vk::StructureChain::assign: use auto, instead of void *, to also support structures with const void * as type for pNext. (#1799)
This commit is contained in:
parent
c74c22fb77
commit
7a048a0cc7
@ -121,10 +121,10 @@
|
|||||||
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
|
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
|
||||||
StructureChain & assign( const T & rhs ) VULKAN_HPP_NOEXCEPT
|
StructureChain & assign( const T & rhs ) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
T & lhs = get<T, Which>();
|
T & lhs = get<T, Which>();
|
||||||
void * pNext = lhs.pNext;
|
auto pNext = lhs.pNext;
|
||||||
lhs = rhs;
|
lhs = rhs;
|
||||||
lhs.pNext = pNext;
|
lhs.pNext = pNext;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +77,9 @@ int main( int /*argc*/, char ** /*argv*/ )
|
|||||||
sc7.assign<vk::PhysicalDeviceIDProperties>( {} );
|
sc7.assign<vk::PhysicalDeviceIDProperties>( {} );
|
||||||
assert( pNext == sc7.get<vk::PhysicalDeviceIDProperties>().pNext );
|
assert( pNext == sc7.get<vk::PhysicalDeviceIDProperties>().pNext );
|
||||||
|
|
||||||
|
vk::StructureChain<vk::DeviceQueueCreateInfo, vk::DeviceQueueGlobalPriorityCreateInfoKHR> sc8;
|
||||||
|
sc8.assign<vk::DeviceQueueGlobalPriorityCreateInfoKHR>( {} );
|
||||||
|
|
||||||
#if !defined( NDEBUG )
|
#if !defined( NDEBUG )
|
||||||
void * pNext1 = sc7.get<vk::PhysicalDeviceMaintenance3Properties>().pNext;
|
void * pNext1 = sc7.get<vk::PhysicalDeviceMaintenance3Properties>().pNext;
|
||||||
#endif
|
#endif
|
||||||
|
@ -723,10 +723,10 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
|
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
|
||||||
StructureChain & assign( const T & rhs ) VULKAN_HPP_NOEXCEPT
|
StructureChain & assign( const T & rhs ) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
T & lhs = get<T, Which>();
|
T & lhs = get<T, Which>();
|
||||||
void * pNext = lhs.pNext;
|
auto pNext = lhs.pNext;
|
||||||
lhs = rhs;
|
lhs = rhs;
|
||||||
lhs.pNext = pNext;
|
lhs.pNext = pNext;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16589,7 +16589,7 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
|
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
|
||||||
}
|
}
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
m_library = ::LoadLibraryA( "vulkan-1.dll" );
|
m_library = ::LoadLibraryA( "vulkan-1.dll" );
|
||||||
# else
|
# else
|
||||||
# error unsupported platform
|
# error unsupported platform
|
||||||
# endif
|
# endif
|
||||||
|
@ -723,10 +723,10 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
|
template <typename T = typename std::tuple_element<0, std::tuple<ChainElements...>>::type, size_t Which = 0>
|
||||||
StructureChain & assign( const T & rhs ) VULKAN_HPP_NOEXCEPT
|
StructureChain & assign( const T & rhs ) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
T & lhs = get<T, Which>();
|
T & lhs = get<T, Which>();
|
||||||
void * pNext = lhs.pNext;
|
auto pNext = lhs.pNext;
|
||||||
lhs = rhs;
|
lhs = rhs;
|
||||||
lhs.pNext = pNext;
|
lhs.pNext = pNext;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6950,7 +6950,7 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
|
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
|
||||||
}
|
}
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
m_library = ::LoadLibraryA( "vulkan-1.dll" );
|
m_library = ::LoadLibraryA( "vulkan-1.dll" );
|
||||||
# else
|
# else
|
||||||
# error unsupported platform
|
# error unsupported platform
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
Reference in New Issue
Block a user