Revert "SkSL function inlining"
This reverts commit b65024b5f237a64c8aca374a84f339cec0965973.
Reason for revert: Shader compilation failures
Original change's description:
> SkSL function inlining
>
> This first pass adds "one size fits all" function inlining, without any
> allowances for simple functions that don't need all of this machinery
> in place. Followup CLs will simplify common cases by e.g. not storing
> arguments in variables if they're already variables and not wrapping
> the function body in a loop when it isn't necessary.
>
> Change-Id: I4fd8c1655ff48b9e4708bcca03a506df34ceadd9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290127
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com
Change-Id: Ia6e643e0dcb66a4f0c2a377b89117047bbc5d058
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290801
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/sksl/SkSLMetalCodeGenerator.cpp b/src/sksl/SkSLMetalCodeGenerator.cpp
index 2b222d8..099ab4c 100644
--- a/src/sksl/SkSLMetalCodeGenerator.cpp
+++ b/src/sksl/SkSLMetalCodeGenerator.cpp
@@ -1164,15 +1164,11 @@
}
void MetalCodeGenerator::writeBlock(const Block& b) {
- if (b.fIsScope) {
- this->writeLine("{");
- fIndentation++;
- }
+ this->writeLine("{");
+ fIndentation++;
this->writeStatements(b.fStatements);
- if (b.fIsScope) {
- fIndentation--;
- this->write("}");
- }
+ fIndentation--;
+ this->write("}");
}
void MetalCodeGenerator::writeIfStatement(const IfStatement& stmt) {