Performance experiment: Disable SkSL optimization in nanobench/skpbench
Change-Id: I974571e7e0e9d0170f92b970d425d9ce530e312e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369716 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
bb1505f2ab
commit
5ad759065d
@ -65,6 +65,7 @@ extern bool gSkForceRasterPipelineBlitter;
|
||||
extern bool gUseSkVMBlitter;
|
||||
extern bool gSkVMAllowJIT;
|
||||
extern bool gSkVMJITViaDylib;
|
||||
extern bool gSkSLAllowOptimization;
|
||||
|
||||
#ifndef SK_BUILD_FOR_WIN
|
||||
#include <unistd.h>
|
||||
@ -1240,6 +1241,7 @@ int main(int argc, char** argv) {
|
||||
gSkForceRasterPipelineBlitter = FLAGS_forceRasterPipeline;
|
||||
gUseSkVMBlitter = FLAGS_skvm;
|
||||
gSkVMAllowJIT = gSkVMJITViaDylib = FLAGS_jit;
|
||||
gSkSLAllowOptimization = false; // Temporary experiment
|
||||
|
||||
int runs = 0;
|
||||
BenchmarkStream benchStream;
|
||||
|
@ -67,6 +67,8 @@
|
||||
|
||||
#endif
|
||||
|
||||
bool gSkSLAllowOptimization = true;
|
||||
|
||||
namespace SkSL {
|
||||
|
||||
using RefKind = VariableReference::RefKind;
|
||||
@ -1606,7 +1608,7 @@ std::unique_ptr<Program> Compiler::convertProgram(
|
||||
bool success = false;
|
||||
if (fErrorCount) {
|
||||
// Do not return programs that failed to compile.
|
||||
} else if (settings.fOptimize && !this->optimize(*program)) {
|
||||
} else if (settings.fOptimize && gSkSLAllowOptimization && !this->optimize(*program)) {
|
||||
// Do not return programs that failed to optimize.
|
||||
} else {
|
||||
// We have a successful program!
|
||||
|
@ -88,6 +88,8 @@ static const char resultFormat[] =
|
||||
|
||||
static constexpr int kNumFlushesToPrimeCache = 3;
|
||||
|
||||
extern bool gSkSLAllowOptimization;
|
||||
|
||||
struct Sample {
|
||||
using duration = std::chrono::nanoseconds;
|
||||
|
||||
@ -496,6 +498,8 @@ int main(int argc, char** argv) {
|
||||
exit(0); // This can be used to print the header and quit.
|
||||
}
|
||||
|
||||
gSkSLAllowOptimization = false; // Temporary experiment
|
||||
|
||||
// Parse the config.
|
||||
const SkCommandLineConfigGpu* config = nullptr; // Initialize for spurious warning.
|
||||
SkCommandLineConfigArray configs;
|
||||
|
Loading…
Reference in New Issue
Block a user