From 9d00429567a54023228edfa340cd2a4d1e877d1e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 16 Mar 2022 11:23:31 +0200 Subject: [PATCH] Only mark Result as checked if that specific value was checked --- source/backends/vulkan/vulkan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/backends/vulkan/vulkan.h b/source/backends/vulkan/vulkan.h index a862acfe..c41813fa 100644 --- a/source/backends/vulkan/vulkan.h +++ b/source/backends/vulkan/vulkan.h @@ -85,7 +85,7 @@ public: Result(Result &&r): result(r.result), function(r.function) { r.result = VK_SUCCESS; } ~Result() noexcept(false) { if(!checked) check(); } - bool operator==(VkResult r) { checked = true; return result==r; } + bool operator==(VkResult r) { bool m = (result==r); checked |= m; return m; } void check() { if(result!=VK_SUCCESS) throw Graphics::vulkan_error(result, function); } }; -- 2.45.2