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 <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2019-03-25 13:32:28 -04:00 committed by Skia Commit-Bot
parent a51e93c9a0
commit f2ae6af713
2 changed files with 2 additions and 15 deletions

View File

@ -152,20 +152,13 @@ void SKPBench::drawPicture() {
#include "GrGpu.h"
static void draw_pic_for_stats(SkCanvas* canvas, GrContext* context, const SkPicture* picture,
SkTArray<SkString>* keys, SkTArray<double>* values,
const char* tag) {
SkTArray<SkString>* keys, SkTArray<double>* 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<SkString>* keys, SkTArray<double>* values) {
@ -180,8 +173,5 @@ void SKPBench::getGpuStats(SkCanvas* canvas, SkTArray<SkString>* 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);
}

View File

@ -464,9 +464,6 @@ void GrGpu::Stats::dump(SkString* out) {
void GrGpu::Stats::dumpKeyValuePairs(SkTArray<SkString>* keys, SkTArray<double>* 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