| Index: experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
|
| diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
|
| index 09762b3326228d79775dc8c3e2ea709701e21cdb..42211e4d7b4840fea90d8844cad6347c4b57ceb5 100644
|
| --- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
|
| +++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
|
| @@ -819,7 +819,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
|
| xCoords.appendf("vec2(%s.x, 0.5)", floorVal);
|
|
|
| noiseCode.appendf("\n\tvec2 %s;\n\t%s.x = ", latticeIdx, latticeIdx);
|
| - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(),
|
| + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str(),
|
| kVec2f_GrSLType);
|
| noiseCode.append(".r;");
|
| }
|
| @@ -830,7 +830,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
|
| xCoords.appendf("vec2(%s.z, 0.5)", floorVal);
|
|
|
| noiseCode.appendf("\n\t%s.y = ", latticeIdx);
|
| - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(),
|
| + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str(),
|
| kVec2f_GrSLType);
|
| noiseCode.append(".r;");
|
| }
|
| @@ -855,7 +855,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
|
| SkString latticeCoords("");
|
| latticeCoords.appendf("vec2(%s.x, %s)", bcoords, chanCoord);
|
| noiseCode.appendf("\n\tvec4 %s = ", lattice);
|
| - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
|
| + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
|
| kVec2f_GrSLType);
|
| noiseCode.appendf(".bgra;\n\t%s.x = ", uv);
|
| noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
|
| @@ -867,7 +867,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
|
| SkString latticeCoords("");
|
| latticeCoords.appendf("vec2(%s.y, %s)", bcoords, chanCoord);
|
| noiseCode.append("\n\tlattice = ");
|
| - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
|
| + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
|
| kVec2f_GrSLType);
|
| noiseCode.appendf(".bgra;\n\t%s.y = ", uv);
|
| noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
|
| @@ -883,7 +883,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
|
| SkString latticeCoords("");
|
| latticeCoords.appendf("vec2(%s.w, %s)", bcoords, chanCoord);
|
| noiseCode.append("\n\tlattice = ");
|
| - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
|
| + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
|
| kVec2f_GrSLType);
|
| noiseCode.appendf(".bgra;\n\t%s.y = ", uv);
|
| noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
|
| @@ -895,7 +895,7 @@ void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
|
| SkString latticeCoords("");
|
| latticeCoords.appendf("vec2(%s.z, %s)", bcoords, chanCoord);
|
| noiseCode.append("\n\tlattice = ");
|
| - fsBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(),
|
| + fsBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
|
| kVec2f_GrSLType);
|
| noiseCode.appendf(".bgra;\n\t%s.x = ", uv);
|
| noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
|
| @@ -1175,7 +1175,7 @@ void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) {
|
| SkString permCode("return ");
|
| // FIXME even though I'm creating these textures with kRepeat_TileMode, they're clamped. Not
|
| // sure why. Using fract() (here and the next texture lookup) as a workaround.
|
| - fsBuilder->appendTextureLookup(&permCode, args.fSamplers[0], "vec2(fract(x / 256.0), 0.0)",
|
| + fsBuilder->appendTextureLookup(&permCode, args.fTexSamplers[0], "vec2(fract(x / 256.0), 0.0)",
|
| kVec2f_GrSLType);
|
| permCode.append(".r * 255.0;");
|
| fsBuilder->emitFunction(kFloat_GrSLType, "perm", SK_ARRAY_COUNT(permArgs), permArgs,
|
| @@ -1188,7 +1188,7 @@ void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) {
|
| };
|
| SkString gradFuncName;
|
| SkString gradCode("return dot(");
|
| - fsBuilder->appendTextureLookup(&gradCode, args.fSamplers[1], "vec2(fract(x / 16.0), 0.0)",
|
| + fsBuilder->appendTextureLookup(&gradCode, args.fTexSamplers[1], "vec2(fract(x / 16.0), 0.0)",
|
| kVec2f_GrSLType);
|
| gradCode.append(".rgb * 255.0 - vec3(1.0), p);");
|
| fsBuilder->emitFunction(kFloat_GrSLType, "grad", SK_ARRAY_COUNT(gradArgs), gradArgs,
|
|
|