Remove `fForceInline` argument from EmitArgs.
This improved codegen when it was first introduced. Since that time, our
inliner has become much smarter and no longer needs these hints.
Change-Id: I7725da1eb9814e656849881ad2ca2b1bc038e4a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384320
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 4ccb705..84ffbc5 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -33,8 +33,7 @@
*args.fFp.childProcessor(childIndex),
"_input",
"_coords",
- coordVars,
- /*forceInline=*/false);
+ coordVars);
fFunctionNames[childIndex] =
fragBuilder->writeProcessorFunction(this->childProcessor(childIndex), childArgs);
}
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h
index 6961f4e..5b6716d 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.h
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h
@@ -99,16 +99,14 @@
const GrFragmentProcessor& fp,
const char* inputColor,
const char* sampleCoord,
- const TransformedCoordVars& transformedCoordVars,
- bool forceInline)
+ const TransformedCoordVars& transformedCoordVars)
: fFragBuilder(fragBuilder)
, fUniformHandler(uniformHandler)
, fShaderCaps(caps)
, fFp(fp)
, fInputColor(inputColor ? inputColor : "half4(1.0)")
, fSampleCoord(sampleCoord)
- , fTransformedCoords(transformedCoordVars)
- , fForceInline(forceInline) {}
+ , fTransformedCoords(transformedCoordVars) {}
GrGLSLFPFragmentBuilder* fFragBuilder;
GrGLSLUniformHandler* fUniformHandler;
const GrShaderCaps* fShaderCaps;
@@ -116,7 +114,6 @@
const char* fInputColor;
const char* fSampleCoord;
const TransformedCoordVars& fTransformedCoords;
- bool fForceInline;
};
virtual void emitCode(EmitArgs&) = 0;
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index bb9741d..aed5fea 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -149,7 +149,7 @@
SkString funcName = this->getMangledFunctionName(args.fFp.name());
this->emitFunction(kHalf4_GrSLType, funcName.c_str(), {params, paramCount},
- this->code().c_str(), args.fForceInline);
+ this->code().c_str());
this->deleteStage();
this->onAfterChildProcEmitCode();
return funcName;
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 7cb29fc..43f6a6c 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -180,8 +180,7 @@
fp,
"_input",
"_coords",
- coords,
- /*forceInline=*/true);
+ coords);
auto name = fFS.writeProcessorFunction(&glslFP, args);
fFS.codeAppendf("%s = %s(%s);", output.c_str(), name.c_str(), input.c_str());
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 5019732..d43da25 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -50,11 +50,8 @@
void GrGLSLShaderBuilder::appendFunctionDecl(GrSLType returnType,
const char* mangledName,
- SkSpan<const GrShaderVar> args,
- bool forceInline) {
- this->functions().appendf("%s%s %s(", forceInline ? "inline " : "",
- GrGLSLTypeString(returnType),
- mangledName);
+ SkSpan<const GrShaderVar> args) {
+ this->functions().appendf("%s %s(", GrGLSLTypeString(returnType), mangledName);
for (size_t i = 0; i < args.size(); ++i) {
if (i > 0) {
this->functions().append(", ");
@@ -68,9 +65,8 @@
void GrGLSLShaderBuilder::emitFunction(GrSLType returnType,
const char* mangledName,
SkSpan<const GrShaderVar> args,
- const char* body,
- bool forceInline) {
- this->appendFunctionDecl(returnType, mangledName, args, forceInline);
+ const char* body) {
+ this->appendFunctionDecl(returnType, mangledName, args);
this->functions().appendf(" {\n"
"%s"
"}\n\n", body);
@@ -84,9 +80,8 @@
void GrGLSLShaderBuilder::emitFunctionPrototype(GrSLType returnType,
const char* mangledName,
- SkSpan<const GrShaderVar> args,
- bool forceInline) {
- this->appendFunctionDecl(returnType, mangledName, args, forceInline);
+ SkSpan<const GrShaderVar> args) {
+ this->appendFunctionDecl(returnType, mangledName, args);
this->functions().append(";\n");
}
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h
index 3021ef2..658a9e2 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.h
@@ -135,15 +135,13 @@
/** Emits a prototype for a helper function outside of main() in the fragment shader. */
void emitFunctionPrototype(GrSLType returnType,
const char* mangledName,
- SkSpan<const GrShaderVar> args,
- bool forceInline = false);
+ SkSpan<const GrShaderVar> args);
/** Emits a helper function outside of main() in the fragment shader. */
void emitFunction(GrSLType returnType,
const char* mangledName,
SkSpan<const GrShaderVar> args,
- const char* body,
- bool forceInline = false);
+ const char* body);
void emitFunction(const char* declaration, const char* body);
@@ -180,8 +178,7 @@
void appendFunctionDecl(GrSLType returnType,
const char* mangledName,
- SkSpan<const GrShaderVar> args,
- bool forceInline);
+ SkSpan<const GrShaderVar> args);
/**
* Features that should only be enabled internally by the builders.