Move program-kind check out of inner benchmark loop.
Noticed that this check could move outside the loop while working on http://review.skia.org/534560, but didn't want to muddle such a straightforward CL with additional changes. Change-Id: I84e0e3348a782f4f5d1b451a48fb14bae87aa33d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534561 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
parent
994a0d60da
commit
378ca242bf
@ -113,10 +113,9 @@ protected:
|
||||
}
|
||||
|
||||
void onDraw(int loops, SkCanvas* canvas) override {
|
||||
const SkSL::ProgramKind kind = this->usesRuntimeShader() ? SkSL::ProgramKind::kRuntimeShader
|
||||
: SkSL::ProgramKind::kFragment;
|
||||
for (int i = 0; i < loops; i++) {
|
||||
const SkSL::ProgramKind kind = this->usesRuntimeShader()
|
||||
? SkSL::ProgramKind::kRuntimeShader
|
||||
: SkSL::ProgramKind::kFragment;
|
||||
std::unique_ptr<SkSL::Program> program = fCompiler.convertProgram(kind, fSrc,
|
||||
fSettings);
|
||||
if (fCompiler.errorCount()) {
|
||||
@ -124,13 +123,13 @@ protected:
|
||||
}
|
||||
std::string result;
|
||||
switch (fOutput) {
|
||||
case Output::kNone: break;
|
||||
case Output::kGLSL: SkAssertResult(fCompiler.toGLSL(*program, &result)); break;
|
||||
case Output::kMetal: SkAssertResult(fCompiler.toMetal(*program, &result)); break;
|
||||
case Output::kSPIRV: SkAssertResult(fCompiler.toSPIRV(*program, &result)); break;
|
||||
case Output::kNone: break;
|
||||
case Output::kGLSL: SkAssertResult(fCompiler.toGLSL(*program, &result)); break;
|
||||
case Output::kMetal: SkAssertResult(fCompiler.toMetal(*program, &result)); break;
|
||||
case Output::kSPIRV: SkAssertResult(fCompiler.toSPIRV(*program, &result)); break;
|
||||
case Output::kSkVM:
|
||||
case Output::kSkVMOpt:
|
||||
case Output::kSkVMJIT: SkAssertResult(CompileToSkVM(*program, fOutput)); break;
|
||||
case Output::kSkVMJIT: SkAssertResult(CompileToSkVM(*program, fOutput)); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user