mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Fixed Device::createResultValue to return ResultValueType<T>::type
Modified to return T & data when exceptions are enabled otherwise return ReturnValue<T>( result, data )
This commit is contained in:
parent
e464d695dd
commit
9a2d54f066
@ -945,17 +945,18 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
VULKAN_HPP_INLINE ResultValue<T> createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )
|
VULKAN_HPP_INLINE typename ResultValueType<T>::type createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )
|
||||||
{
|
{
|
||||||
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
|
assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
|
||||||
|
return ResultValue<T>( result, data );
|
||||||
#else
|
#else
|
||||||
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
|
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
|
||||||
{
|
{
|
||||||
throwResultException( result, message );
|
throwResultException( result, message );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return ResultValue<T>( result, data );
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
using SampleMask = uint32_t;
|
using SampleMask = uint32_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user