From: Mikko Rasa Date: Wed, 16 Mar 2022 09:23:31 +0000 (+0200) Subject: Only mark Result as checked if that specific value was checked X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9d00429567a54023228edfa340cd2a4d1e877d1e;p=libs%2Fgl.git Only mark Result as checked if that specific value was checked --- 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); } };