mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-25 02:10:51 +00:00
examples: Added --fixed-fps and --screenshot for deterministic captures. (#3998)
This commit is contained in:
committed by
GitHub
parent
c00cc181cc
commit
d79de7ac63
@@ -417,7 +417,11 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
const bgfx::Stats* stats = bgfx::getStats();
|
||||
const double toMsCpu = 1000.0/stats->cpuTimerFreq;
|
||||
const double toMsGpu = 1000.0/stats->gpuTimerFreq;
|
||||
const double frameMs = double(stats->cpuTimeFrame)*toMsCpu;
|
||||
const bool fixedTime = bx::Ticks(bx::InitZero) != entry::getFixedTimeStep();
|
||||
const double frameMs = fixedTime
|
||||
? bx::toMilliseconds<double>(entry::getFixedTimeStep() )
|
||||
: double(stats->cpuTimeFrame)*toMsCpu
|
||||
;
|
||||
|
||||
s_frameTime.pushSample(float(frameMs) );
|
||||
|
||||
@@ -444,8 +448,8 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::Text("Submit CPU %0.3f, GPU %0.3f (L: %d)"
|
||||
, double(stats->cpuTimeEnd - stats->cpuTimeBegin)*toMsCpu
|
||||
, double(stats->gpuTimeEnd - stats->gpuTimeBegin)*toMsGpu
|
||||
, fixedTime ? 0.0 : double(stats->cpuTimeEnd - stats->cpuTimeBegin)*toMsCpu
|
||||
, fixedTime ? 0.0 : double(stats->gpuTimeEnd - stats->gpuTimeBegin)*toMsGpu
|
||||
, stats->maxGpuLatency
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user