wren
Vulkan-based game engine
Loading...
Searching...
No Matches
result.hpp File Reference
#include <boost/describe.hpp>
#include <boost/preprocessor.hpp>
#include <vulkan/vulkan.hpp>
#include <vulkan/vulkan_enums.hpp>
#include <vulkan/vulkan_to_string.hpp>
#include <wren/utils/result.hpp>
Include dependency graph for result.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  vk
 
namespace  wren
 

Macros

#define VK_TRY_RESULT_1(unique, expr)
 
#define VK_TRY_RESULT_2(unique, out, expr)
 
#define VK_TRY_RESULT(...)
 
#define VK_TIE_RESULT_IMPL(unique, out, expr)
 
#define VK_TIE_RESULT(...)   VK_TIE_RESULT_IMPL(RESULT_UNIQUE_NAME(), __VA_ARGS__)
 
#define VK_CHECK_RESULT_IMPL(unique, expr)
 
#define VK_CHECK_RESULT(expr)   VK_CHECK_RESULT_IMPL(RESULT_UNIQUE_NAME(), (expr))
 
#define VK_ERR_PROP(out, err)
 
#define VK_ERR_PROP_VOID(err)
 
#define VK_TIE_ERR_PROP(out, err)
 

Functions

 vk::BOOST_DESCRIBE_ENUM (Result, eSuccess, eNotReady, eTimeout, eEventSet, eEventReset, eIncomplete, eErrorOutOfHostMemory, eErrorOutOfDeviceMemory, eErrorInitializationFailed, eErrorDeviceLost, eErrorMemoryMapFailed, eErrorLayerNotPresent, eErrorExtensionNotPresent, eErrorFeatureNotPresent, eErrorIncompatibleDriver, eErrorTooManyObjects, eErrorFormatNotSupported, eErrorFragmentedPool, eErrorUnknown, eErrorOutOfPoolMemory, eErrorOutOfPoolMemoryKHR, eErrorInvalidExternalHandle, eErrorInvalidExternalHandleKHR, eErrorFragmentation, eErrorFragmentationEXT, eErrorInvalidOpaqueCaptureAddress, eErrorInvalidDeviceAddressEXT, eErrorInvalidOpaqueCaptureAddressKHR, ePipelineCompileRequired, eErrorPipelineCompileRequiredEXT, ePipelineCompileRequiredEXT, eErrorSurfaceLostKHR, eErrorNativeWindowInUseKHR, eSuboptimalKHR, eErrorOutOfDateKHR, eErrorIncompatibleDisplayKHR, eErrorValidationFailedEXT, eErrorInvalidShaderNV, eErrorImageUsageNotSupportedKHR, eErrorVideoPictureLayoutNotSupportedKHR, eErrorVideoProfileOperationNotSupportedKHR, eErrorVideoProfileFormatNotSupportedKHR, eErrorVideoProfileCodecNotSupportedKHR, eErrorVideoStdVersionNotSupportedKHR, eErrorInvalidDrmFormatModifierPlaneLayoutEXT, eErrorNotPermittedKHR, eErrorNotPermittedEXT, eThreadIdleKHR, eThreadDoneKHR, eOperationDeferredKHR, eOperationNotDeferredKHR, eErrorCompressionExhaustedEXT)
 

Macro Definition Documentation

◆ VK_CHECK_RESULT

#define VK_CHECK_RESULT ( expr)    VK_CHECK_RESULT_IMPL(RESULT_UNIQUE_NAME(), (expr))

◆ VK_CHECK_RESULT_IMPL

#define VK_CHECK_RESULT_IMPL ( unique,
expr )
Value:
::vk::Result unique = (expr); \
if ((unique) != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(unique));

◆ VK_ERR_PROP

#define VK_ERR_PROP ( out,
err )
Value:
auto [LINEIZE(res, __LINE__), out] = err; \
if (LINEIZE(res, __LINE__) != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(LINEIZE(res, __LINE__)));
#define LINEIZE(n, line)
Definition macros.hpp:4

◆ VK_ERR_PROP_VOID

#define VK_ERR_PROP_VOID ( err)
Value:
::vk::Result LINEIZE(res, __LINE__) = err; \
if (LINEIZE(res, __LINE__) != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(LINEIZE(res, __LINE__)));

◆ VK_TIE_ERR_PROP

#define VK_TIE_ERR_PROP ( out,
err )
Value:
::vk::Result LINEIZE(res, __LINE__) = ::vk::Result::eSuccess; \
std::tie(LINEIZE(res, __LINE__), out) = err; \
if (LINEIZE(res, __LINE__) != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(LINEIZE(res, __LINE__)));

◆ VK_TIE_RESULT

#define VK_TIE_RESULT ( ...)    VK_TIE_RESULT_IMPL(RESULT_UNIQUE_NAME(), __VA_ARGS__)

◆ VK_TIE_RESULT_IMPL

#define VK_TIE_RESULT_IMPL ( unique,
out,
expr )
Value:
::vk::Result unique = ::vk::Result::eSuccess; \
std::tie(unique, out) = expr; \
if (unique != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(unique));

◆ VK_TRY_RESULT

#define VK_TRY_RESULT ( ...)
Value:
BOOST_PP_OVERLOAD(VK_TRY_RESULT_, __VA_ARGS__) \
(RESULT_UNIQUE_NAME(), __VA_ARGS__)
#define RESULT_UNIQUE_NAME()
Definition result.hpp:92

◆ VK_TRY_RESULT_1

#define VK_TRY_RESULT_1 ( unique,
expr )
Value:
auto [unique, BOOST_PP_CAT(unique, _out)] = expr; \
if (unique != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(unique));

◆ VK_TRY_RESULT_2

#define VK_TRY_RESULT_2 ( unique,
out,
expr )
Value:
auto [unique, out] = expr; \
if (unique != ::vk::Result::eSuccess) \
return std::unexpected(make_error_code(unique));