Rename a shader variable to please MSL.

"vertex" is a reserved word in MSL. Rename the variable to "position".

Change-Id: I20a8bdd443cbdb1a41496728fc1ff388a02e1d24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222105
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2019-06-19 14:19:47 -04:00 committed by Skia Commit-Bot
parent 2c3398dc26
commit 1e1ad8dda9

View File

@ -61,7 +61,7 @@ class GrGLSLProgramDataManager;
namespace skiagm { namespace skiagm {
static constexpr GrGeometryProcessor::Attribute gVertex = static constexpr GrGeometryProcessor::Attribute gVertex =
{"vertex", kFloat2_GrVertexAttribType, kFloat2_GrSLType}; {"position", kFloat2_GrVertexAttribType, kFloat2_GrSLType};
/** /**
* This is a GPU-backend specific test. It ensures that SkSL properly identifies clockwise-winding * This is a GPU-backend specific test. It ensures that SkSL properly identifies clockwise-winding
@ -104,7 +104,7 @@ class GLSLClockwiseTestProcessor : public GrGLSLGeometryProcessor {
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
const ClockwiseTestProcessor& proc = args.fGP.cast<ClockwiseTestProcessor>(); const ClockwiseTestProcessor& proc = args.fGP.cast<ClockwiseTestProcessor>();
args.fVaryingHandler->emitAttributes(proc); args.fVaryingHandler->emitAttributes(proc);
gpArgs->fPositionVar.set(kFloat2_GrSLType, "vertex"); gpArgs->fPositionVar.set(kFloat2_GrSLType, "position");
args.fFragBuilder->codeAppendf( args.fFragBuilder->codeAppendf(
"%s = sk_Clockwise ? half4(0,1,0,1) : half4(1,0,0,1);", args.fOutputColor); "%s = sk_Clockwise ? half4(0,1,0,1) : half4(1,0,0,1);", args.fOutputColor);
if (!proc.fReadSkFragCoord) { if (!proc.fReadSkFragCoord) {