Disable output swizzling from GrDisableColorXP
This makes sure the final shader does not output a color.
Bug: skia:
Change-Id: I1e5299bb63391d6ff72598ed72fe4fb80b18fa07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206352
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 5c4b1dc..5670f58 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -242,9 +242,12 @@
}
const char* GrGLSLFragmentShaderBuilder::getSecondaryColorOutputName() const {
- const GrShaderCaps& caps = *fProgramBuilder->shaderCaps();
- return caps.mustDeclareFragmentShaderOutput() ? DeclaredSecondaryColorOutputName()
- : "gl_SecondaryFragColorEXT";
+ if (this->hasSecondaryOutput()) {
+ return (fProgramBuilder->shaderCaps()->mustDeclareFragmentShaderOutput())
+ ? DeclaredSecondaryColorOutputName()
+ : "gl_SecondaryFragColorEXT";
+ }
+ return nullptr;
}
GrSurfaceOrigin GrGLSLFragmentShaderBuilder::getSurfaceOrigin() const {