Index: src/gpu/glsl/GrGLSLProgramBuilder.cpp |
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp |
index a6bff8a85ac983fadd717d80f17ee5e4f19bc068..f32042d821810eb0bdafb347d55d087636b75bcf 100644 |
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp |
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp |
@@ -88,11 +88,17 @@ void GrGLSLProgramBuilder::emitAndInstallPrimProc(const GrPrimitiveProcessor& pr |
this->nameExpression(outputCoverage, "outputCoverage"); |
const char* distanceVectorName = nullptr; |
- if (this->fPipeline.usesDistanceVectorField() && proc.implementsDistanceVector()) { |
+ if (this->fPipeline.usesDistanceVectorField()) { |
distanceVectorName = fFS.distanceVectorName(); |
fFS.codeAppend( "// Normalized vector to the closest geometric edge (in device space)\n"); |
fFS.codeAppend( "// Distance to the edge encoded in the z-component\n"); |
- fFS.codeAppendf("vec4 %s;", distanceVectorName); |
+ |
+ if (proc.implementsDistanceVector()) { |
+ fFS.codeAppendf("vec4 %s;", distanceVectorName); |
+ } else { |
+ fFS.codeAppendf("vec4 %s = vec4(1,0,0,0); // not implemented by primitive processor\n", |
+ distanceVectorName); |
+ } |
} |
// Enclose custom code in a block to avoid namespace conflicts |