Add "reduced shader" testing mode.
Currently doesn't do anything other than add new configs that set
a GrContextOption that becomes available in GrCaps. Runs new configs
on Perf/Test bots (MTL/iPhone11 and GL/Ubuntu).
Bug: skia:11844
Change-Id: I58586cae0980e52701abd1633dbc79b381f6015b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394996
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 0e6e2e5..d84aa51 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -474,6 +474,13 @@
fWindow->setRequestedDisplayParams(params);
fWindow->inval();
});
+ fCommands.addCommand('w', "Modes", "Toggle reduced shaders", [this]() {
+ DisplayParams params = fWindow->getRequestedDisplayParams();
+ params.fGrContextOptions.fReducedShaderVariations =
+ !params.fGrContextOptions.fReducedShaderVariations;
+ fWindow->setRequestedDisplayParams(params);
+ fWindow->inval();
+ });
fCommands.addCommand(skui::Key::kRight, "Right", "Navigation", "Next slide", [this]() {
this->setCurrentSlide(fCurrentSlide < fSlides.count() - 1 ? fCurrentSlide + 1 : 0);
});
@@ -1828,6 +1835,11 @@
paramsChanged = true;
}
+ bool* reducedShaders = ¶ms.fGrContextOptions.fReducedShaderVariations;
+ if (ctx && ImGui::Checkbox("Reduced shaders", reducedShaders)) {
+ paramsChanged = true;
+ }
+
if (ctx) {
// Determine the context's max sample count for MSAA radio buttons.
int sampleCount = fWindow->sampleCount();