Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Benchmark: GPU time per phase (gpu_ms from the frame governor's GL_TIME_ELAPSED queries)

islandmedaa4f8c7c0df9
diff --git a/src/app/App.h b/src/app/App.h
index aab72eff..a2632675 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -2060,6 +2060,8 @@ private:
// The last drawn frame's time by part (run()'s marks): events, dabs, UI, ghost + scene sync (the upload), draw,
// UI draw + swap (where the frame waits for the GPU).
double frameSplitMs_[6] = {};
+ // GPU time of frames (GL_TIME_ELAPSED, a few frames late) since Help > Benchmark last took them.
+ std::vector<double> proofGpuMs_;
// The view's resolution while it moves (experimental, docs/design/perf-moonshots.md §0): 0.75 on the simulated
// floor tier (SF_HW_SIMULATE=floor), else 1; SF_MOTION_RESOLUTION=25..100 (percent) overrides.
static float motionResolution();
diff --git a/src/app/PanelPerformanceProfile.cpp b/src/app/PanelPerformanceProfile.cpp
index 489f7b54..352e4b89 100644
--- a/src/app/PanelPerformanceProfile.cpp
+++ b/src/app/PanelPerformanceProfile.cpp
@@ -260,6 +260,7 @@ void App::hardwareProfileFrameEnd() {
hw.pending.pop_front();
s.gpuMs = gpuMs;
hw.lastGpuMs = gpuMs;
+ if (proof_ && proofGpuMs_.size() < 4096) proofGpuMs_.push_back(gpuMs);
changed = hw.governor.addFrame(s) || changed;
}
}
diff --git a/src/app/ProofMode.cpp b/src/app/ProofMode.cpp
index 47de7d7b..9b666e24 100644
--- a/src/app/ProofMode.cpp
+++ b/src/app/ProofMode.cpp
@@ -383,6 +383,7 @@ struct PhaseResult {
std::vector<double> frameMs, lagMs, lagPx;
std::vector<double> previewLagPx; // the predictive preview's head behind the pointer (the surface's without it)
std::vector<double> drawn; // triangles each frame drew (Renderer::lastDrawnTriangles)
+ std::vector<double> gpuMs; // GPU time of the phase's frames (GL_TIME_ELAPSED; empty without timer queries)
std::vector<double> split[6]; // each frame by part (App::frameSplitMs_, the frame before: the swap comes after)
};
@@ -739,6 +740,7 @@ void App::proofBeforeSwap(int fbW, int fbH) {
r.phases.back().radiusPx = spec.radiusPx;
if (spec.radiusPx > 0) r.phases.back().brush = proofBrushName(spec.brush);
p.stageStart = p.lastFrame = nowSeconds(); // (not counting what the last phase's release cost)
+ proofGpuMs_.clear(); // (frames from before the phase)
p.samples.clear();
p.dabs.clear();
p.sent = 1;
@@ -892,6 +894,8 @@ void App::proofBeforeSwap(int fbW, int fbH) {
ph.frameMs.push_back(frameMs);
for (int k = 0; k < 6; ++k) ph.split[k].push_back(frameSplitMs_[k]);
ph.drawn.push_back(double(renderer_.lastDrawnTriangles()));
+ ph.gpuMs.insert(ph.gpuMs.end(), proofGpuMs_.begin(), proofGpuMs_.end());
+ proofGpuMs_.clear();
}
const double u = std::min(1.0, (now - p.stageStart) / spec.seconds);
if (spec.radiusPx <= 0) { // orbit: the view turns, as a drag would
@@ -1050,6 +1054,10 @@ void App::proofBeforeSwap(int fbW, int fbH) {
for (int k = 0; k < 6; ++k) split.set(names[k], percentilesJson(percentiles(ph.split[k])));
j.set("frame_split_ms", split);
j.set("triangles_drawn", percentilesJson(percentiles(ph.drawn)));
+ if (!ph.gpuMs.empty()) { // (the GPU's own work, no compositor; fewer than "frames": results that came too late)
+ j.set("gpu_ms", percentilesJson(percentiles(ph.gpuMs)));
+ j.set("gpu_frames", double(ph.gpuMs.size()));
+ }
j.set("render_triangle_budget", double(renderTriangleBudget()));
}
if (ph.radiusPx > 0) {