From 961b9e7a9e62bbd688bd85b58541d66a7f2acc55 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Fri, 27 Sep 2024 14:51:54 -0500 Subject: vulkaninfo: Only iterate 2-call idiom when needed Previous implementation would always run the function 3 times no matter what. --- vulkaninfo/vulkaninfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h index 41c8ed5f..7b2e2265 100644 --- a/vulkaninfo/vulkaninfo.h +++ b/vulkaninfo/vulkaninfo.h @@ -243,8 +243,8 @@ auto GetVectorInit(const char *func_name, F &&f, T init, Ts &&...ts) -> std::vec err = f(ts..., &count, results.data()); results.resize(count); iteration_count++; - } while (err == VK_INCOMPLETE || iteration_count < max_iterations); - if (err && iteration_count <= max_iterations) THROW_VK_ERR(func_name, err); + } while (err == VK_INCOMPLETE && iteration_count < max_iterations); + if (err) THROW_VK_ERR(func_name, err); return results; } -- cgit v1.2.3