From 720afde0275ace97b9db19573e4c59cab1c539ed Mon Sep 17 00:00:00 2001 From: takayhan-AMD <123373764+takayhan-AMD@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:28:19 +0100 Subject: [PATCH] Allow setting benchmarking warmup time to 0 seconds to skip warmup phase (#1112) Sometimes it's desired to render exactly N (--c N) frames. --- base/benchmark.hpp | 2 +- base/vulkanexamplebase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/benchmark.hpp b/base/benchmark.hpp index bae91a6a..b7f00558 100644 --- a/base/benchmark.hpp +++ b/base/benchmark.hpp @@ -24,7 +24,7 @@ namespace vks bool active = false; bool outputFrameTimes = false; int outputFrames = -1; // -1 means no frames limit - uint32_t warmup = 1; + uint32_t warmup = 1; // Default to 1 sec of warm-up uint32_t duration = 10; std::vector frameTimes; std::string filename = ""; diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 2f31d1be..fad5993e 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -849,7 +849,7 @@ VulkanExampleBase::VulkanExampleBase() vks::tools::errorModeSilent = true; } if (commandLineParser.isSet("benchmarkwarmup")) { - benchmark.warmup = commandLineParser.getValueAsInt("benchmarkwarmup", benchmark.warmup); + benchmark.warmup = commandLineParser.getValueAsInt("benchmarkwarmup", 0); } if (commandLineParser.isSet("benchmarkruntime")) { benchmark.duration = commandLineParser.getValueAsInt("benchmarkruntime", benchmark.duration);