From 8fb45371b8a0d47a387f9e0c50e7700af14e3a7e Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 12 Mar 2026 19:13:55 +1100 Subject: Check for bad returns on vulkan calls (lol!) --- src/context.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/context.hh') diff --git a/src/context.hh b/src/context.hh index 91fbf91..6524984 100644 --- a/src/context.hh +++ b/src/context.hh @@ -3,6 +3,11 @@ namespace low_latency { +#define THROW_NON_VKSUCCESS(x) \ + if (const auto result = x; result != VK_SUCCESS) { \ + throw result; \ + } + // A context class doesn't do much by itself. We just use it to provide a // virtual destructor so we can store a bunch of shared_ptrs in the same // container and rely on RTTI in the layer context. It also deletes the copy and @@ -10,10 +15,9 @@ namespace low_latency { // // We _could_ do something weird and complicated where we define virtual pure // hashing and equality functions so we can store them in an unordered_set, but -// it's just unnecessary complexity and doesn't allow us to perform 'do you exist' -// lookups without creating an object. +// it's just unnecessary complexity and doesn't allow us to perform 'do you +// exist' lookups without creating an object. class Context { - public: Context(); Context(const Context& context) = delete; -- cgit v1.2.3