diff options
| author | Charles Giessen <charles@lunarg.com> | 2024-09-27 14:51:54 -0500 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2024-09-27 14:42:28 -0600 |
| commit | 961b9e7a9e62bbd688bd85b58541d66a7f2acc55 (patch) | |
| tree | 9b2ea7e1e11c7664f1bf189c2caf30aca1552a97 | |
| parent | 05e068941b49277189d0bbcdc5f722724eb3c5a3 (diff) | |
| download | usermoji-961b9e7a9e62bbd688bd85b58541d66a7f2acc55.tar.xz | |
vulkaninfo: Only iterate 2-call idiom when needed
Previous implementation would always run the function 3 times no matter what.
| -rw-r--r-- | vulkaninfo/vulkaninfo.h | 4 |
1 files 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; } |
