From f2ae6af713129778e65641ce0801fc318a5a620a Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 25 Mar 2019 13:32:28 -0400 Subject: [PATCH] Stop flooding perf with uninteresting GPU stats We only care about two things: RT binds and shader compiles. RT binds should be constant frame-to-frame, and shader compiles should always be zero on frame 2, so just measure on frame 1. Bug: skia: Change-Id: I4defa0a6dc79413b375ec60b5024fa57e768b127 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203391 Reviewed-by: Robert Phillips Commit-Queue: Brian Osman --- bench/SKPBench.cpp | 14 ++------------ src/gpu/GrGpu.cpp | 3 --- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp index 66786dc1f6..7617fe30b2 100644 --- a/bench/SKPBench.cpp +++ b/bench/SKPBench.cpp @@ -152,20 +152,13 @@ void SKPBench::drawPicture() { #include "GrGpu.h" static void draw_pic_for_stats(SkCanvas* canvas, GrContext* context, const SkPicture* picture, - SkTArray* keys, SkTArray* values, - const char* tag) { + SkTArray* keys, SkTArray* values) { context->priv().resetGpuStats(); canvas->drawPicture(picture); canvas->flush(); - int offset = keys->count(); context->priv().dumpGpuStatsKeyValuePairs(keys, values); context->priv().dumpCacheStatsKeyValuePairs(keys, values); - - // append tag, but only to new tags - for (int i = offset; i < keys->count(); i++, offset++) { - (*keys)[i].appendf("_%s", tag); - } } void SKPBench::getGpuStats(SkCanvas* canvas, SkTArray* keys, SkTArray* values) { @@ -180,8 +173,5 @@ void SKPBench::getGpuStats(SkCanvas* canvas, SkTArray* keys, SkTArray< context->freeGpuResources(); context->resetContext(); context->priv().getGpu()->resetShaderCacheForTesting(); - draw_pic_for_stats(canvas, context, fPic.get(), keys, values, "first_frame"); - - // draw second frame - draw_pic_for_stats(canvas, context, fPic.get(), keys, values, "second_frame"); + draw_pic_for_stats(canvas, context, fPic.get(), keys, values); } diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index fe5bb20433..ad0df866a8 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -464,9 +464,6 @@ void GrGpu::Stats::dump(SkString* out) { void GrGpu::Stats::dumpKeyValuePairs(SkTArray* keys, SkTArray* values) { keys->push_back(SkString("render_target_binds")); values->push_back(fRenderTargetBinds); keys->push_back(SkString("shader_compilations")); values->push_back(fShaderCompilations); - keys->push_back(SkString("texture_uploads")); values->push_back(fTextureUploads); - keys->push_back(SkString("number_of_draws")); values->push_back(fNumDraws); - keys->push_back(SkString("number_of_failed_draws")); values->push_back(fNumFailedDraws); } #endif