Skip to content

Commit

Permalink
vulkaninfo: Only iterate 2-call idiom when needed
Browse files Browse the repository at this point in the history
Previous implementation would always run the function 3 times no matter what.
  • Loading branch information
charles-lunarg committed Sep 27, 2024
1 parent 05e0689 commit 961b9e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vulkaninfo/vulkaninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 961b9e7

Please sign in to comment.