re-land of added sk_FragCoord support to skslc
BUG=skia:
Change-Id: Ifac1aa39839058787ad1794200c3dbb93c147a69
Reviewed-on: https://skia-review.googlesource.com/5850
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/bench/GLBench.cpp b/bench/GLBench.cpp
index 38205e2..0fcd56f 100644
--- a/bench/GLBench.cpp
+++ b/bench/GLBench.cpp
@@ -68,14 +68,15 @@
GrGLuint GLBench::CompileShader(const GrGLContext* context, const char* sksl, GrGLenum type) {
const GrGLInterface* gl = context->interface();
SkString glsl;
- bool result = context->compiler()->toGLSL(type == GR_GL_VERTEX_SHADER
- ? SkSL::Program::kVertex_Kind
+ SkSL::Program::Settings settings;
+ settings.fCaps = context->caps()->shaderCaps();
+ std::unique_ptr<SkSL::Program> program = context->compiler()->convertProgram(
+ type == GR_GL_VERTEX_SHADER ? SkSL::Program::kVertex_Kind
: SkSL::Program::kFragment_Kind,
- SkString(sksl),
- *context->caps()->shaderCaps(),
- &glsl);
- if (!result) {
- SkDebugf("SkSL compilation failed:\n%s\n%s\n", sksl,
+ SkString(sksl),
+ settings);
+ if (!program || !context->compiler()->toGLSL(*program, &glsl)) {
+ SkDebugf("SkSL compilation failed:\n%s\n%s\n", sksl,
context->compiler()->errorText().c_str());
}
GrGLuint shader;