diff --git a/USAGE_android.md b/USAGE_android.md index 7ce826b68d..ad8ff88bd2 100644 --- a/USAGE_android.md +++ b/USAGE_android.md @@ -830,7 +830,7 @@ optional arguments: case the results would include the last frame). (forwarded to replay tool) --measurement-file DEVICE_FILE - Write measurements to a file at the specified path. + File in which measurements are written. Default is: '/sdcard/gfxrecon-measurements.json' on android and './gfxrecon-measurements.json' on desktop. (forwarded to replay tool) diff --git a/USAGE_desktop_Vulkan.md b/USAGE_desktop_Vulkan.md index e7c60b500e..14bafa2d47 100644 --- a/USAGE_desktop_Vulkan.md +++ b/USAGE_desktop_Vulkan.md @@ -699,7 +699,7 @@ Optional arguments: last frame in the trace it will be clamped to the frame after the last (so in that case the results would include the last frame). --measurement-file - Write measurements to a file at the specified path. + File in which measurements are written. Default is: '/sdcard/gfxrecon-measurements.json' on android and './gfxrecon-measurements.json' on desktop. --quit-after-measurement-range diff --git a/android/scripts/gfxrecon.py b/android/scripts/gfxrecon.py index 225892952c..34424f5f87 100644 --- a/android/scripts/gfxrecon.py +++ b/android/scripts/gfxrecon.py @@ -112,7 +112,7 @@ def CreateReplayParser(): parser.add_argument('--use-colorspace-fallback', action='store_true', default=False, help='Swap the swapchain color space if unsupported by replay device. Check if color space is not supported by replay device and swap to VK_COLOR_SPACE_SRGB_NONLINEAR_KHR. (forwarded to replay tool).') parser.add_argument('--offscreen-swapchain-frame-boundary', action='store_true', default=False, help='Should only be used with offscreen swapchain. Activates the extension VK_EXT_frame_boundary (always supported if trimming, checks for driver support otherwise) and inserts command buffer submission with VkFrameBoundaryEXT where vkQueuePresentKHR was called in the original capture. This allows preserving frames when capturing a replay that uses. offscreen swapchain. (forwarded to replay tool)') parser.add_argument('--mfr', '--measurement-frame-range', metavar='START-END', help='Custom framerange to measure FPS for. This range will include the start frame but not the end frame. The measurement frame range defaults to all frames except the loading frame but can be configured for any range. If the end frame is past the last frame in the trace it will be clamped to the frame after the last (so in that case the results would include the last frame). (forwarded to replay tool)') - parser.add_argument('--measurement-file', metavar='DEVICE_FILE', help='Write measurements to a file at the specified path. Default is: \'/sdcard/gfxrecon-measurements.json\' on android and \'./gfxrecon-measurements.json\' on desktop. (forwarded to replay tool)') + parser.add_argument('--measurement-file', metavar='DEVICE_FILE', help='File in which measurements are written. Default is: \'/sdcard/gfxrecon-measurements.json\' on android and \'./gfxrecon-measurements.json\' on desktop. (forwarded to replay tool)') parser.add_argument('--quit-after-measurement-range', action='store_true', default=False, help='If this is specified the replayer will abort when it reaches the specified in the --measurement-frame-range argument. (forwarded to replay tool)') parser.add_argument('--flush-measurement-range', action='store_true', default=False, help='If this is specified the replayer will flush and wait for all current GPU work to finish at the start and end of the measurement range. (forwarded to replay tool)') parser.add_argument('--flush-inside-measurement-range', action='store_true', default=False, help='If this is specified the replayer will flush and wait for all current GPU work to finish at end of each frame inside the measurement range. (forwarded to replay tool)') diff --git a/framework/graphics/fps_info.cpp b/framework/graphics/fps_info.cpp index 507e2a76fe..6b31e58639 100644 --- a/framework/graphics/fps_info.cpp +++ b/framework/graphics/fps_info.cpp @@ -26,41 +26,16 @@ #include "util/date_time.h" #include "util/logging.h" #include "util/platform.h" +#include "nlohmann/json.hpp" #include "util/json_util.h" -#include "nlohmann/json.hpp" #include GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(graphics) -static double GetElapsedSeconds(uint64_t start_time, uint64_t end_time) -{ - return util::datetime::ConvertTimestampToSeconds( - util::datetime::DiffTimestamps(static_cast(start_time), static_cast(end_time))); -} - -static void -WriteFpsToConsole(const char* prefix, uint64_t start_frame, uint64_t end_frame, int64_t start_time, int64_t end_time) -{ - assert(end_frame >= start_frame && end_time >= start_time); - - double diff_time_sec = GetElapsedSeconds(static_cast(start_time), static_cast(end_time)); - uint64_t total_frames = (end_frame - start_frame) + 1; - double fps = (diff_time_sec > 0.0) ? (static_cast(total_frames) / diff_time_sec) : 0.0; - GFXRECON_WRITE_CONSOLE("%s %f fps, %f seconds, %" PRIu64 " frame%s, framerange %" PRIu64 "-%" PRIu64, - prefix, - fps, - diff_time_sec, - total_frames, - total_frames > 1 ? "s" : "", - start_frame, - end_frame); -} - FpsInfo::FpsInfo(uint64_t measurement_start_frame, uint64_t measurement_end_frame, - bool has_measurement_range, bool quit_after_range, bool flush_measurement_range, bool flush_inside_measurement_range, @@ -68,17 +43,19 @@ FpsInfo::FpsInfo(uint64_t measurement_start_frame, const std::string_view measurement_file_name, bool quit_after_frame, uint64_t quit_frame) : - measurement_start_frame_(measurement_start_frame), - measurement_end_frame_(measurement_end_frame), measurement_start_time_(0), measurement_end_time_(0), - has_measurement_range_(has_measurement_range), quit_after_range_(quit_after_range), + start_time_(0), replay_start_time_(0), replay_end_time_(0), measurement_start_time_(0), measurement_end_time_(0), + measurement_start_boot_time_(0), measurement_end_boot_time_(0), measurement_start_process_time_(0), + measurement_end_process_time_(0), replay_start_frame_(0), measurement_start_frame_(measurement_start_frame), + measurement_end_frame_(measurement_end_frame), quit_after_range_(quit_after_range), flush_measurement_range_(flush_measurement_range), flush_inside_measurement_range_(flush_inside_measurement_range), - started_measurement_(false), ended_measurement_(false), frame_start_time_(0), frame_durations_(), - measurement_file_name_(measurement_file_name), preload_measurement_range_(preload_measurement_range), + started_measurement_(false), ended_measurement_(false), preload_measurement_range_(preload_measurement_range), + measurement_file_name_(measurement_file_name), frame_start_time_(0), frame_durations_(), quit_after_frame_(quit_after_frame), quit_frame_(quit_frame) { - if (has_measurement_range_) + if (util::filepath::IsFile(measurement_file_name_)) { - GFXRECON_ASSERT(!measurement_file_name_.empty()); + // To avoid thinking an ancient file is the result of this run + std::remove(measurement_file_name_.c_str()); } } @@ -105,8 +82,11 @@ void FpsInfo::BeginFrame(uint64_t frame) { if (frame >= measurement_start_frame_) { - measurement_start_time_ = util::datetime::GetTimestamp(); - started_measurement_ = true; + measurement_start_boot_time_ = util::datetime::GetBootTime(); + measurement_start_time_ = util::datetime::GetTimestamp(); + measurement_start_process_time_ = util::datetime::GetProcessTime(); + started_measurement_ = true; + GFXRECON_WRITE_CONSOLE("================== Start timer (Frame: %llu) ==================", frame); frame_durations_.clear(); } } @@ -118,64 +98,16 @@ void FpsInfo::EndFrame(uint64_t frame) { if (started_measurement_ && !ended_measurement_) { - frame_durations_.push_back(util::datetime::DiffTimestamps(frame_start_time_, util::datetime::GetTimestamp())); + int64_t frame_end_time = util::datetime::GetTimestamp(); + frame_durations_.push_back(util::datetime::DiffTimestamps(frame_start_time_, frame_end_time)); // Measurement frame range end is non-inclusive, as opposed to trim frame range if (frame >= measurement_end_frame_ - 1) { - measurement_end_time_ = util::datetime::GetTimestamp(); - ended_measurement_ = true; - - // Save measurements to file - if (!measurement_file_name_.empty()) - { - double start_time = util::datetime::ConvertTimestampToSeconds(measurement_start_time_); - double end_time = util::datetime::ConvertTimestampToSeconds(measurement_end_time_); - double diff_time = GetElapsedSeconds(static_cast(measurement_start_time_), - static_cast(measurement_end_time_)); - uint64_t total_frames = measurement_end_frame_ - measurement_start_frame_; - double fps = static_cast(total_frames) / diff_time; - - nlohmann::json file_content = { { "frame_range", - { { "start_frame", measurement_start_frame_ }, - { "end_frame", measurement_end_frame_ }, - { "frame_count", total_frames }, - { "start_time_monotonic", start_time }, - { "end_time_monotonic", end_time }, - { "duration", diff_time }, - { "fps", fps }, - { "frame_durations", frame_durations_ } } } }; - - FILE* file_pointer = nullptr; - int32_t result = util::platform::FileOpen(&file_pointer, measurement_file_name_.c_str(), "w"); - if (result == 0) - { - const std::string json_string = file_content.dump(util::kJsonIndentWidth); - - // It either writes a fully valid file, or it doesn't write anything ! - if (!util::platform::FileWrite(json_string.data(), json_string.size(), file_pointer)) - { - GFXRECON_LOG_ERROR("Failed to write to measurements file '%s'.", - measurement_file_name_.c_str()); - - // Try to delete the partial file from disk using - const int remove_result = std::remove(measurement_file_name_.c_str()); - if (remove_result != 0) - { - GFXRECON_LOG_ERROR("Failed to remove measurements file '%s' (Error %i).", - measurement_file_name_.c_str(), - remove_result); - } - } - util::platform::FileClose(file_pointer); - } - else - { - GFXRECON_LOG_ERROR( - "Failed to open measurements file '%s' (Error %i).", measurement_file_name_.c_str(), result); - GFXRECON_LOG_ERROR("%s", std::strerror(result)); - } - } + measurement_end_boot_time_ = util::datetime::GetBootTime(); + measurement_end_process_time_ = util::datetime::GetProcessTime(); + measurement_end_time_ = frame_end_time; + ended_measurement_ = true; } } } @@ -189,10 +121,14 @@ bool FpsInfo::ShouldWaitIdleAfterFrame(uint64_t frame) void FpsInfo::EndFile(uint64_t frame) { + replay_end_time_ = gfxrecon::util::datetime::GetTimestamp(); + if (!ended_measurement_) { - measurement_end_time_ = gfxrecon::util::datetime::GetTimestamp(); - measurement_end_frame_ = frame; + measurement_end_boot_time_ = util::datetime::GetBootTime(); + measurement_end_process_time_ = util::datetime::GetProcessTime(); + measurement_end_time_ = replay_end_time_; + measurement_end_frame_ = frame; } } @@ -202,41 +138,71 @@ void FpsInfo::ProcessStateEndMarker(uint64_t frame_number) replay_start_time_ = static_cast(util::datetime::GetTimestamp()); } -void FpsInfo::LogToConsole() +void FpsInfo::LogMeasurements() { - if (!has_measurement_range_) + double start_time_monotonic = util::datetime::ConvertTimestampToSeconds(measurement_start_time_); + double end_time_monotonic = util::datetime::ConvertTimestampToSeconds(measurement_end_time_); + + double load_time = util::datetime::GetElapsedSeconds(start_time_, replay_start_time_); + double total_time = util::datetime::GetElapsedSeconds(start_time_, replay_end_time_); + double measured_time = util::datetime::GetElapsedSeconds(measurement_start_time_, measurement_end_time_); + uint64_t measured_frames = measurement_end_frame_ - measurement_start_frame_; + double measured_fps = (measured_time > 0.0) ? static_cast(measured_frames) / measured_time : 0.0; + + GFXRECON_WRITE_CONSOLE("Load time: %f seconds (frame %lu)", load_time, replay_start_frame_); + GFXRECON_WRITE_CONSOLE("Total time: %f seconds", total_time); + GFXRECON_WRITE_CONSOLE("Measured FPS: %f fps, %f seconds, %lu frame%s, 1 loop, framerange [%lu-%lu)", + measured_fps, + measured_time, + measured_frames, + measured_frames > 1 ? "s" : "", + measurement_start_frame_, + measurement_end_frame_); + + // Save measurements to file + + nlohmann::json file_content = { { "frame_range", + { { "start_frame", measurement_start_frame_ }, + { "end_frame", measurement_end_frame_ }, + { "frame_count", measured_frames }, + { "start_time_boot", measurement_start_boot_time_ }, + { "start_time_process", measurement_start_process_time_ }, + { "start_time_monotonic", start_time_monotonic }, + { "end_time_boot", measurement_end_boot_time_ }, + { "end_time_process", measurement_end_process_time_ }, + { "end_time_monotonic", end_time_monotonic }, + { "duration", measured_time }, + { "fps", measured_fps }, + { "frame_durations", frame_durations_ } } } }; + + FILE* file_pointer = nullptr; + int32_t result = util::platform::FileOpen(&file_pointer, measurement_file_name_.c_str(), "w"); + if (result == 0) { - // No measurement range or no end limit to range, include trimmed - // range load statistics. + const std::string json_string = file_content.dump(util::kJsonIndentWidth); - if (replay_start_time_ != start_time_) + const bool success = util::platform::FileWrite(json_string.data(), json_string.size(), file_pointer); + util::platform::FileClose(file_pointer); + + // It either writes a fully valid file, or it doesn't write anything ! + if (!success) { - GFXRECON_WRITE_CONSOLE("Load time: %f seconds", GetElapsedSeconds(start_time_, replay_start_time_)); + GFXRECON_LOG_ERROR("Failed to write to measurements file '%s'.", measurement_file_name_.c_str()); + + // Try to delete the partial file from disk using + const int remove_result = std::remove(measurement_file_name_.c_str()); + if (remove_result != 0) + { + GFXRECON_LOG_ERROR("Failed to remove measurements file '%s' (Error %i).", + measurement_file_name_.c_str(), + remove_result); + } } - GFXRECON_WRITE_CONSOLE("Total time: %f seconds", - GetElapsedSeconds(start_time_, static_cast(measurement_end_time_))); - - WriteFpsToConsole("Replay FPS:", - static_cast(replay_start_frame_), - measurement_end_frame_ - 1 + static_cast(replay_start_frame_) - 1, - static_cast(replay_start_time_), - measurement_end_time_); } else { - // There was a measurement range, emit only statistics about the - // measurement range - double diff_time_sec = GetElapsedSeconds(static_cast(measurement_start_time_), - static_cast(measurement_end_time_)); - uint64_t total_frames = measurement_end_frame_ - measurement_start_frame_; - double fps = static_cast(total_frames) / diff_time_sec; - GFXRECON_WRITE_CONSOLE("Measurement range FPS: %f fps, %f seconds, %lu frame%s, 1 loop, framerange [%lu-%lu)", - fps, - diff_time_sec, - total_frames, - total_frames > 1 ? "s" : "", - measurement_start_frame_, - measurement_end_frame_); + GFXRECON_LOG_ERROR("Failed to open measurements file '%s' (Error %i).", measurement_file_name_.c_str(), result); + GFXRECON_LOG_ERROR("%s", std::strerror(result)); } } diff --git a/framework/graphics/fps_info.h b/framework/graphics/fps_info.h index 606892ccc3..88e04582fd 100644 --- a/framework/graphics/fps_info.h +++ b/framework/graphics/fps_info.h @@ -38,7 +38,6 @@ class FpsInfo public: explicit FpsInfo(uint64_t measurement_start_frame = 1, uint64_t measurement_end_frame = std::numeric_limits::max(), - bool has_measurement_range = false, bool quit_after_range = false, bool flush_measurement_range = false, bool flush_inside_measurement_range = false, @@ -47,7 +46,7 @@ class FpsInfo bool quit_after_frame = false, uint64_t quit_frame = std::numeric_limits::max()); - void LogToConsole(); + void LogMeasurements(); void BeginFile(); bool ShouldWaitIdleBeforeFrame(uint64_t file_processor_frame); @@ -60,18 +59,25 @@ class FpsInfo [[nodiscard]] uint64_t ShouldPreloadFrames(uint64_t current_frame) const; private: - uint64_t start_time_{}; + uint64_t start_time_; - uint64_t measurement_start_frame_; - uint64_t measurement_end_frame_; + int64_t replay_start_time_; + int64_t replay_end_time_; int64_t measurement_start_time_; int64_t measurement_end_time_; - int64_t replay_start_time_; + double measurement_start_boot_time_; + double measurement_end_boot_time_; + + double measurement_start_process_time_; + double measurement_end_process_time_; + uint64_t replay_start_frame_; - bool has_measurement_range_; + uint64_t measurement_start_frame_; + uint64_t measurement_end_frame_; + bool quit_after_range_; bool flush_measurement_range_; bool flush_inside_measurement_range_; diff --git a/framework/util/date_time.h b/framework/util/date_time.h index 816193e680..1ac1a73b7a 100644 --- a/framework/util/date_time.h +++ b/framework/util/date_time.h @@ -46,7 +46,7 @@ GFXRECON_BEGIN_NAMESPACE(datetime) #if defined(WIN32) ///@ Retrieve a timestamp, relative to an undefined reference point, suitable for computing time intervals. -inline uint64_t GetTimestamp() +inline int64_t GetTimestamp() { LARGE_INTEGER StartingTime; LARGE_INTEGER Frequency; @@ -99,6 +99,11 @@ inline double ConvertTimestampToSeconds(int64_t timestamp) return static_cast(timestamp) / 1000000000.0; } +inline double GetElapsedSeconds(int64_t start_timestamp, int64_t end_timestamp) +{ + return ConvertTimestampToSeconds(DiffTimestamps(start_timestamp, end_timestamp)); +} + /// @brief Generate a compact representation of the current time. /// @param use_gmt Use a location-independent time zone if true, else the local /// one. @@ -113,6 +118,58 @@ std::string UtcString(const time_t seconds_since_epoch); /// rfc3339. std::string UtcNowString(); +#if defined(WIN32) + +// Time in seconds since boot +inline double GetBootTime() +{ + return ConvertTimestampToSeconds(GetTimestamp()); +} + +// Time in seconds consumed by this process +inline double GetProcessTime() +{ + ULONG64 CycleTime; + + // Get time and convert ticks to seconds + QueryProcessCycleTime(GetCurrentProcess(), &CycleTime); + return (static_cast(CycleTime) / CLOCKS_PER_SEC); +} + +#else // !defined(WIN32) + +// Time in seconds since boot +inline double GetBootTime() +{ +#if defined(CLOCK_BOOTTIME) + + timespec time; + clock_gettime(CLOCK_BOOTTIME, &time); + int64_t timestamp = (1000000000 * static_cast(time.tv_sec)) + static_cast(time.tv_nsec); + return ConvertTimestampToSeconds(timestamp); + +#else + return 0.0; +#endif +} + +// Time in seconds consumed by this process +inline double GetProcessTime() +{ +#if defined(CLOCK_PROCESS_CPUTIME_ID) + + timespec time; + clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time); + int64_t timestamp = (1000000000 * static_cast(time.tv_sec)) + static_cast(time.tv_nsec); + return ConvertTimestampToSeconds(timestamp); + +#else + return 0.0; +#endif +} + +#endif // WIN32 + GFXRECON_END_NAMESPACE(datetime) GFXRECON_END_NAMESPACE(util) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/tools/replay/android_main.cpp b/tools/replay/android_main.cpp index 60d9f9e929..c0693a2d98 100644 --- a/tools/replay/android_main.cpp +++ b/tools/replay/android_main.cpp @@ -149,14 +149,13 @@ void android_main(struct android_app* app) gfxrecon::decode::VulkanReplayConsumer vulkan_replay_consumer(application, replay_options); gfxrecon::decode::VulkanDecoder vulkan_decoder; - uint32_t start_frame, end_frame; - bool has_mfr = GetMeasurementFrameRange(arg_parser, start_frame, end_frame); - std::string measurement_file_name; - if (has_mfr) - { - GetMeasurementFilename(arg_parser, measurement_file_name); - } + uint32_t measurement_start_frame; + uint32_t measurement_end_frame; + GetMeasurementFrameRange(arg_parser, measurement_start_frame, measurement_end_frame); + + std::string measurement_file_name; + GetMeasurementFilename(arg_parser, measurement_file_name); bool quit_after_frame = false; uint32_t quit_frame; @@ -167,9 +166,8 @@ void android_main(struct android_app* app) GetQuitAfterFrame(arg_parser, quit_frame); } - gfxrecon::graphics::FpsInfo fps_info(static_cast(start_frame), - static_cast(end_frame), - has_mfr, + gfxrecon::graphics::FpsInfo fps_info(static_cast(measurement_start_frame), + static_cast(measurement_end_frame), replay_options.quit_after_measurement_frame_range, replay_options.flush_measurement_frame_range, replay_options.flush_inside_measurement_range, @@ -208,17 +206,17 @@ void android_main(struct android_app* app) if ((file_processor->GetCurrentFrameNumber() > 0) && (file_processor->GetErrorState() == gfxrecon::decode::FileProcessor::kErrorNone)) { - if (file_processor->GetCurrentFrameNumber() < start_frame) + if (file_processor->GetCurrentFrameNumber() < measurement_start_frame) { GFXRECON_LOG_WARNING( "Measurement range start frame (%u) is greater than the last replayed frame (%u). " "Measurements were never started, cannot calculate measurement range FPS.", - start_frame, + measurement_start_frame, file_processor->GetCurrentFrameNumber()); } else { - fps_info.LogToConsole(); + fps_info.LogMeasurements(); } } else if (file_processor->GetErrorState() != gfxrecon::decode::FileProcessor::kErrorNone) diff --git a/tools/replay/desktop_main.cpp b/tools/replay/desktop_main.cpp index 127f4dfab7..265cf28afa 100644 --- a/tools/replay/desktop_main.cpp +++ b/tools/replay/desktop_main.cpp @@ -183,13 +183,12 @@ int main(int argc, const char** argv) return -1; } - uint32_t start_frame = 0; - uint32_t end_frame = 0; - bool quit_after_frame = false; uint32_t quit_frame = std::numeric_limits::max(); - bool has_mfr = false; + uint32_t measurement_start_frame = 0; + uint32_t measurement_end_frame = 0; + bool quit_after_measurement_frame_range = false; bool flush_measurement_frame_range = false; bool flush_inside_measurement_range = false; @@ -198,7 +197,8 @@ int main(int argc, const char** argv) if (vulkan_replay_options.enable_vulkan) { - has_mfr = GetMeasurementFrameRange(arg_parser, start_frame, end_frame); + GetMeasurementFrameRange(arg_parser, measurement_start_frame, measurement_end_frame); + GetMeasurementFilename(arg_parser, measurement_file_name); quit_after_measurement_frame_range = vulkan_replay_options.quit_after_measurement_frame_range; flush_measurement_frame_range = vulkan_replay_options.flush_measurement_frame_range; flush_inside_measurement_range = vulkan_replay_options.flush_inside_measurement_range; @@ -211,14 +211,8 @@ int main(int argc, const char** argv) } } - if (has_mfr) - { - GetMeasurementFilename(arg_parser, measurement_file_name); - } - - gfxrecon::graphics::FpsInfo fps_info(static_cast(start_frame), - static_cast(end_frame), - has_mfr, + gfxrecon::graphics::FpsInfo fps_info(static_cast(measurement_start_frame), + static_cast(measurement_end_frame), quit_after_measurement_frame_range, flush_measurement_frame_range, flush_inside_measurement_range, @@ -318,12 +312,12 @@ int main(int argc, const char** argv) if ((file_processor->GetCurrentFrameNumber() > 0) && (file_processor->GetErrorState() == gfxrecon::decode::FileProcessor::kErrorNone)) { - if (file_processor->GetCurrentFrameNumber() < start_frame) + if (file_processor->GetCurrentFrameNumber() < measurement_start_frame) { GFXRECON_LOG_WARNING( "Measurement range start frame (%u) is greater than the last replayed frame (%u). " "Measurements were never started, cannot calculate measurement range FPS.", - start_frame, + measurement_start_frame, file_processor->GetCurrentFrameNumber()); } else @@ -341,7 +335,7 @@ int main(int argc, const char** argv) } #endif - fps_info.LogToConsole(); + fps_info.LogMeasurements(); } } else if (file_processor->GetErrorState() != gfxrecon::decode::FileProcessor::kErrorNone) diff --git a/tools/replay/replay_settings.h b/tools/replay/replay_settings.h index ecc08d5644..d1695b6ee0 100644 --- a/tools/replay/replay_settings.h +++ b/tools/replay/replay_settings.h @@ -259,7 +259,7 @@ static void PrintUsage(const char* exe_name) GFXRECON_WRITE_CONSOLE(" \t\tCheck if color space is not supported by replay device and fallback to " "VK_COLOR_SPACE_SRGB_NONLINEAR_KHR."); GFXRECON_WRITE_CONSOLE(" --measurement-file "); - GFXRECON_WRITE_CONSOLE(" \t\tWrite measurements to a file at the specified path."); + GFXRECON_WRITE_CONSOLE(" \t\tFile in which measurements are written."); GFXRECON_WRITE_CONSOLE(" \t\tDefault is: '/sdcard/gfxrecon-measurements.json' on android and"); GFXRECON_WRITE_CONSOLE(" \t\t'./gfxrecon-measurements.json' on desktop."); GFXRECON_WRITE_CONSOLE(" --quit-after-measurement-range"); diff --git a/tools/tool_settings.h b/tools/tool_settings.h index e61a1ae7a7..26eac2e53d 100644 --- a/tools/tool_settings.h +++ b/tools/tool_settings.h @@ -719,7 +719,7 @@ static bool GetQuitAfterFrame(const gfxrecon::util::ArgumentParser& arg_parser, return false; } -static bool +static void GetMeasurementFrameRange(const gfxrecon::util::ArgumentParser& arg_parser, uint32_t& start_frame, uint32_t& end_frame) { start_frame = 1; @@ -765,17 +765,12 @@ GetMeasurementFrameRange(const gfxrecon::util::ArgumentParser& arg_parser, uint3 GFXRECON_LOG_WARNING("Ignoring invalid measurement frame range \"%s\", where first frame is " "greater than or equal to the last frame", value.c_str()); - - return false; } start_frame = start_frame_arg; end_frame = end_frame_arg; - return true; } } - - return false; } static gfxrecon::decode::CreateResourceAllocator GetCreateResourceAllocatorFunc(const gfxrecon::util::ArgumentParser& arg_parser,