mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
pstats: Perf improvement for smooth mode in strip chart with dropped frames
This significantly improves PStats strip chart performance with high frame rates and high number of dropped frames
This commit is contained in:
parent
07902429b8
commit
91c22a0fd6
@ -672,16 +672,25 @@ compute_average_pixel_data(PStatStripChart::FrameData &result,
|
||||
double last = then_end;
|
||||
|
||||
// Then we get all of each of the middle frames.
|
||||
double weight = 0.0;
|
||||
for (int frame_number = then_i + 1;
|
||||
frame_number < now_i;
|
||||
frame_number++) {
|
||||
if (thread_data->has_frame(frame_number)) {
|
||||
if (weight > 0.0) {
|
||||
accumulate_frame_data(result, *fdata, weight);
|
||||
weight = 0.0;
|
||||
}
|
||||
fdata = &get_frame_data(frame_number);
|
||||
}
|
||||
accumulate_frame_data(result, *fdata, fdata->_end - last);
|
||||
weight += fdata->_end - last;
|
||||
last = fdata->_end;
|
||||
}
|
||||
|
||||
if (weight > 0.0) {
|
||||
accumulate_frame_data(result, *fdata, weight);
|
||||
}
|
||||
|
||||
// And finally, we get the remainder as now_i.
|
||||
if (last <= now) {
|
||||
accumulate_frame_data(result, get_frame_data(now_i), now - last);
|
||||
|
Loading…
x
Reference in New Issue
Block a user