2024-04-08 09:40:53 +00:00
|
|
|
|
|
|
|
namespace detail
|
2022-07-28 15:09:08 +00:00
|
|
|
{
|
2024-04-08 09:40:53 +00:00
|
|
|
VULKAN_HPP_INLINE void resultCheck( Result result, char const * message )
|
|
|
|
{
|
2022-07-28 15:09:08 +00:00
|
|
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
2024-04-08 09:40:53 +00:00
|
|
|
VULKAN_HPP_NAMESPACE::detail::ignore( result ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
|
|
|
|
VULKAN_HPP_NAMESPACE::detail::ignore( message );
|
|
|
|
VULKAN_HPP_ASSERT_ON_RESULT( result == Result::eSuccess );
|
2022-07-28 15:09:08 +00:00
|
|
|
#else
|
2024-04-08 09:40:53 +00:00
|
|
|
if ( result != Result::eSuccess )
|
|
|
|
{
|
|
|
|
VULKAN_HPP_NAMESPACE::detail::throwResultException( result, message );
|
|
|
|
}
|
2022-07-28 15:09:08 +00:00
|
|
|
#endif
|
2024-04-08 09:40:53 +00:00
|
|
|
}
|
2022-07-28 15:09:08 +00:00
|
|
|
|
2024-04-08 09:40:53 +00:00
|
|
|
VULKAN_HPP_INLINE void resultCheck( Result result, char const * message, std::initializer_list<Result> successCodes )
|
|
|
|
{
|
2022-07-28 15:09:08 +00:00
|
|
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
2024-04-08 09:40:53 +00:00
|
|
|
VULKAN_HPP_NAMESPACE::detail::ignore( result ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
|
|
|
|
VULKAN_HPP_NAMESPACE::detail::ignore( message );
|
|
|
|
VULKAN_HPP_NAMESPACE::detail::ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
|
|
|
|
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
|
2022-07-28 15:09:08 +00:00
|
|
|
#else
|
2024-04-08 09:40:53 +00:00
|
|
|
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
|
|
|
|
{
|
|
|
|
VULKAN_HPP_NAMESPACE::detail::throwResultException( result, message );
|
|
|
|
}
|
2022-07-28 15:09:08 +00:00
|
|
|
#endif
|
2024-04-08 09:40:53 +00:00
|
|
|
}
|
|
|
|
} // namespace detail
|