Merge pull request #232 from kingdom5500/master

add 0.1% lows to the brief benchmark overlay
pull/243/head
flightlessmango 4 years ago committed by GitHub
commit 58f0dc4040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -785,10 +785,12 @@ void calculate_benchmark_data(){
benchmark.avg = benchmark.total / sorted.size();
// 1% min
benchmark.total = 0.f;
for (size_t i = 0; i < sorted.size() * 0.1; i++){
for (size_t i = 0; i < sorted.size() * 0.01; i++){
benchmark.total = sorted[i];
}
benchmark.oneP = benchmark.total;
// 0.1% min
benchmark.pointOneP = sorted[sorted.size() * 0.001];
}
void update_hud_info(struct swapchain_stats& sw_stats, struct overlay_params& params, uint32_t vendorID){
@ -1015,14 +1017,14 @@ void render_mpris_metadata(swapchain_stats& data, const ImVec4& color, metadata&
void render_benchmark(swapchain_stats& data, struct overlay_params& params, ImVec2& window_size, unsigned height, uint64_t now){
// TODO, FIX LOG_DURATION FOR BENCHMARK
int benchHeight = 5 * params.font_size + 10.0f + 58;
int benchHeight = 6 * params.font_size + 10.0f + 58;
ImGui::SetNextWindowSize(ImVec2(window_size.x, benchHeight), ImGuiCond_Always);
if (height - (window_size.y + data.main_window_pos.y + 5) < benchHeight)
ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y - benchHeight - 5), ImGuiCond_Always);
else
ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y + window_size.y + 5), ImGuiCond_Always);
vector<pair<string, float>> benchmark_data = {{"97%", benchmark.ninety}, {"AVG", benchmark.avg}, {"1% ", benchmark.oneP}};
vector<pair<string, float>> benchmark_data = {{"97% ", benchmark.ninety}, {"AVG ", benchmark.avg}, {"1% ", benchmark.oneP}, {"0.1%", benchmark.pointOneP}};
float display_time = float(now - log_end) / 1000000;
float display_for = 10.0f;
float alpha;

@ -55,6 +55,7 @@ struct benchmark_stats {
float ninety;
float avg;
float oneP;
float pointOneP;
float total;
std::vector<float> fps_data;
};

Loading…
Cancel
Save