aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLCompiler.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-09-18 02:41:08 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-18 03:01:47 +0000
commit27185a9b9756d2f5fcc077c6c2c005259d4ba517 (patch)
tree7b1747160cb0fb3fb69ecd61de24f4310ee8cf7b /src/sksl/SkSLCompiler.cpp
parent56fbbd65807d1c4ff63b5233764c6e15cba51bb4 (diff)
Revert "Revert "Revert "Switched highp float to highfloat and mediump float to half."""
This reverts commit 05d5a13fea6246648de7e41358ed338d53c85ea2. Reason for revert: looks like it broke filterfastbounds Original change's description: > Revert "Revert "Switched highp float to highfloat and mediump float to half."" > > This reverts commit 1d816b92bb7cf2258007f3f74ffd143b89f25d01. > > Bug: skia: > Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1 > Reviewed-on: https://skia-review.googlesource.com/46464 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> TBR=bsalomon@google.com,ethannicholas@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: Iddf6aef2ab084aa73da7ceebdfc303a1d2b80cde Reviewed-on: https://skia-review.googlesource.com/47441 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLCompiler.cpp')
-rw-r--r--src/sksl/SkSLCompiler.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 5373f9d5a2..638e4d64bf 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -196,8 +196,9 @@ Compiler::Compiler(Flags flags)
*fContext.fSkArgs_Type, Variable::kGlobal_Storage);
fIRGenerator->fSymbolTable->add(skArgsName, std::unique_ptr<Symbol>(skArgs));
- std::vector<std::unique_ptr<ProgramElement>> ignored;
- fIRGenerator->convertProgram(SKSL_INCLUDE, strlen(SKSL_INCLUDE), *fTypes, &ignored);
+ Modifiers::Flag ignored1;
+ std::vector<std::unique_ptr<ProgramElement>> ignored2;
+ fIRGenerator->convertProgram(SKSL_INCLUDE, strlen(SKSL_INCLUDE), *fTypes, &ignored1, &ignored2);
fIRGenerator->fSymbolTable->markAllFunctionsBuiltin();
if (fErrorCount) {
printf("Unexpected errors: %s\n", fErrorText.c_str());
@@ -1133,28 +1134,31 @@ std::unique_ptr<Program> Compiler::convertProgram(Program::Kind kind, String tex
fErrorCount = 0;
fIRGenerator->start(&settings);
std::vector<std::unique_ptr<ProgramElement>> elements;
+ Modifiers::Flag ignored;
switch (kind) {
case Program::kVertex_Kind:
fIRGenerator->convertProgram(SKSL_VERT_INCLUDE, strlen(SKSL_VERT_INCLUDE), *fTypes,
- &elements);
+ &ignored, &elements);
break;
case Program::kFragment_Kind:
fIRGenerator->convertProgram(SKSL_FRAG_INCLUDE, strlen(SKSL_FRAG_INCLUDE), *fTypes,
- &elements);
+ &ignored, &elements);
break;
case Program::kGeometry_Kind:
fIRGenerator->convertProgram(SKSL_GEOM_INCLUDE, strlen(SKSL_GEOM_INCLUDE), *fTypes,
- &elements);
+ &ignored, &elements);
break;
case Program::kFragmentProcessor_Kind:
fIRGenerator->convertProgram(SKSL_FP_INCLUDE, strlen(SKSL_FP_INCLUDE), *fTypes,
- &elements);
+ &ignored, &elements);
break;
}
fIRGenerator->fSymbolTable->markAllFunctionsBuiltin();
+ Modifiers::Flag defaultPrecision;
std::unique_ptr<String> textPtr(new String(std::move(text)));
fSource = textPtr.get();
- fIRGenerator->convertProgram(textPtr->c_str(), textPtr->size(), *fTypes, &elements);
+ fIRGenerator->convertProgram(textPtr->c_str(), textPtr->size(), *fTypes, &defaultPrecision,
+ &elements);
if (!fErrorCount) {
for (auto& element : elements) {
if (element->fKind == ProgramElement::kFunction_Kind) {
@@ -1162,10 +1166,8 @@ std::unique_ptr<Program> Compiler::convertProgram(Program::Kind kind, String tex
}
}
}
- auto result = std::unique_ptr<Program>(new Program(kind,
- std::move(textPtr),
- settings,
- &fContext,
+ auto result = std::unique_ptr<Program>(new Program(kind, std::move(textPtr), settings,
+ defaultPrecision, &fContext,
std::move(elements),
fIRGenerator->fSymbolTable,
fIRGenerator->fInputs));