aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLProgramBuilder.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2016-07-30 14:21:10 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-30 14:21:10 -0700
commit02aed95f9c7c6745c02e9aa8604d27d7a3ae93db (patch)
treebf573a00bea3456ce3fcc43c052aa9ae107b60fe /src/gpu/glsl/GrGLSLProgramBuilder.cpp
parent7c0db75f40f588d91884dfbf3c207d040f3d802d (diff)
Revert of GrFP can express distance vector field req., program builder declares variable for it (patchset #20 id:370001 of https://codereview.chromium.org/2114993002/ )
Reason for revert: UBSAN says we're reading a bad bool here: bool usesDistanceVectorField() const { return fUsesDistanceVectorField; } ../../../include/gpu/GrPaint.h:83:51: runtime error: load of value 239, which is not a valid value for type 'bool' SUMMARY: AddressSanitizer: undefined-behavior ../../../include/gpu/GrPaint.h:83:51 in Seems likely also the root of Valgrind failure: https://luci-milo.appspot.com/swarming/task/30522e4f2241cb10 Original issue's description: > GrFP can express distance vector field req., program builder declares variable for it > > This update allows fragment processors to require a field of vectors to the nearest edge. This requirement propagates: > > - from child FPs to their parent > - from parent FPs to the GrPaint > - from GrPaint through the PipelineBuilder into GrPipeline > - acessed from GrPipeline by GrGLSLProgramBuilder > > GrGLSL generates a variable for the distance vector and passes it down to the GeometryProcessor->emitCode() method. > > This CL's base is the CL for adding the BevelNormalSource API: https://codereview.chromium.org/2080993002 > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2114993002 > > Committed: https://skia.googlesource.com/skia/+/4ef6dfa7089c092c67b0d5ec34e89c1e319af196 TBR=egdaniel@google.com,robertphillips@google.com,bsalomon@google.com,dvonbeck@google.com # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=skia: Review-Url: https://codereview.chromium.org/2201613002
Diffstat (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.cpp')
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 1f28f19bb9..64bc0640b9 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -87,13 +87,6 @@ void GrGLSLProgramBuilder::emitAndInstallPrimProc(const GrPrimitiveProcessor& pr
this->nameExpression(outputColor, "outputColor");
this->nameExpression(outputCoverage, "outputCoverage");
- const char* distanceVectorName = nullptr;
- if (this->fPipeline.usesDistanceVectorField() && proc.implementsDistanceVector()) {
- distanceVectorName = fFS.distanceVectorName();
- fFS.codeAppend( "// Un-normalized vector to the closed geometric edge (in source space)\n");
- fFS.codeAppendf("vec2 %s;", distanceVectorName);
- }
-
// Enclose custom code in a block to avoid namespace conflicts
SkString openBrace;
openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name());
@@ -115,7 +108,6 @@ void GrGLSLProgramBuilder::emitAndInstallPrimProc(const GrPrimitiveProcessor& pr
proc,
outputColor->c_str(),
outputCoverage->c_str(),
- distanceVectorName,
texSamplers.begin(),
bufferSamplers.begin(),
fCoordTransforms,
@@ -169,9 +161,7 @@ void GrGLSLProgramBuilder::emitAndInstallFragProc(const GrFragmentProcessor& fp,
input.isOnes() ? nullptr : input.c_str(),
fOutCoords[index],
texSamplers.begin(),
- bufferSamplers.begin(),
- this->primitiveProcessor().implementsDistanceVector());
-
+ bufferSamplers.begin());
fragProc->emitCode(args);
// We have to check that effects and the code they emit are consistent, ie if an effect