mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-11-01 21:55:31 +00:00
view stats: Make CPU and GPU timestamps available (#1921)
* view stats: Make GPU begin and end times available * view stats: Make CPU start and end times available * view stats: Remove redundant `gpuTimeElapsed` Value can be derived by `gpuTimeEnd - gpuTimeBegin` * view stats: Remove redundant `cpuTimeElapsed` Value can be derived by `cpuTimeEnd - cpuTimeBegin`
This commit is contained in:
@@ -438,8 +438,10 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
ImGui::Text("%3d %3d %s", pos, viewStats.view, viewStats.name);
|
||||
|
||||
const float maxWidth = 30.0f*scale;
|
||||
const float cpuWidth = bx::clamp(float(viewStats.cpuTimeElapsed*toCpuMs)*scale, 1.0f, maxWidth);
|
||||
const float gpuWidth = bx::clamp(float(viewStats.gpuTimeElapsed*toGpuMs)*scale, 1.0f, maxWidth);
|
||||
const float cpuTimeElapsed = float((viewStats.cpuTimeEnd - viewStats.cpuTimeBegin) * toCpuMs);
|
||||
const float gpuTimeElapsed = float((viewStats.gpuTimeEnd - viewStats.gpuTimeBegin) * toGpuMs);
|
||||
const float cpuWidth = bx::clamp(cpuTimeElapsed*scale, 1.0f, maxWidth);
|
||||
const float gpuWidth = bx::clamp(gpuTimeElapsed*scale, 1.0f, maxWidth);
|
||||
|
||||
ImGui::SameLine(64.0f);
|
||||
|
||||
@@ -448,7 +450,7 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
ImGui::SetTooltip("View %d \"%s\", CPU: %f [ms]"
|
||||
, pos
|
||||
, viewStats.name
|
||||
, viewStats.cpuTimeElapsed*toCpuMs
|
||||
, cpuTimeElapsed
|
||||
);
|
||||
}
|
||||
|
||||
@@ -458,7 +460,7 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
ImGui::SetTooltip("View: %d \"%s\", GPU: %f [ms]"
|
||||
, pos
|
||||
, viewStats.name
|
||||
, viewStats.gpuTimeElapsed*toGpuMs
|
||||
, gpuTimeElapsed
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user