aboutsummaryrefslogtreecommitdiff
path: root/src/context.hh
diff options
context:
space:
mode:
authorNicolas James <nj3ahxac@gmail.com>2026-03-12 19:13:55 +1100
committerNicolas James <nj3ahxac@gmail.com>2026-03-12 19:13:55 +1100
commit8fb45371b8a0d47a387f9e0c50e7700af14e3a7e (patch)
treedb18874ca2547777783bc1acf20bcb08f22ed7b1 /src/context.hh
parent44d88e25df14b7e191a15bfbe002a875d7c67056 (diff)
Check for bad returns on vulkan calls (lol!)
Diffstat (limited to 'src/context.hh')
-rw-r--r--src/context.hh10
1 files changed, 7 insertions, 3 deletions
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;