]> git.tdb.fi Git - libs/gl.git/commitdiff
Only mark Result as checked if that specific value was checked
authorMikko Rasa <tdb@tdb.fi>
Wed, 16 Mar 2022 09:23:31 +0000 (11:23 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 16 Mar 2022 09:23:31 +0000 (11:23 +0200)
source/backends/vulkan/vulkan.h

index a862acfe50a710e56ac9adbf117f83b32ae57471..c41813fa8a588f4f822942b92eba72c859f913b9 100644 (file)
@@ -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); }
 };