diff options
author | Brian Osman <brianosman@google.com> | 2017-05-25 11:34:38 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-25 16:15:07 +0000 |
commit | ac1e4964e7816de1f4977b52fa5f2f372537468b (patch) | |
tree | aebc6f877d48d956f72908b6cd27fd290502e156 /include/gpu/GrShaderCaps.h | |
parent | 3fdd0bf2d90b1b82c1ac3aa982bdca600de7f4a8 (diff) |
Workaround Mali static analysis bug
Comment describes it: Unless we do something to confuse their optimizer,
they will (incorrectly) deduce that uniform opaque color (modulated only
by a texture fetch) is always going to remain opaque. Then they skip
inserting their shader based blending code, turning SrcOver into Src.
Doing a max against zero is enough to squelch the optimization.
Bug: skia:
Change-Id: I74676cebb0b0c8d121da868dd8a88050e0cfcc0d
Reviewed-on: https://skia-review.googlesource.com/17924
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/gpu/GrShaderCaps.h')
-rw-r--r-- | include/gpu/GrShaderCaps.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/gpu/GrShaderCaps.h b/include/gpu/GrShaderCaps.h index e52bcf1c81..e5edc7ebea 100644 --- a/include/gpu/GrShaderCaps.h +++ b/include/gpu/GrShaderCaps.h @@ -161,6 +161,8 @@ public: // On MacBook, geometry shaders break if they have more than one invocation. bool mustImplementGSInvocationsWithLoop() const { return fMustImplementGSInvocationsWithLoop; } + bool mustObfuscateUniformColor() const { return fMustObfuscateUniformColor; } + // Returns the string of an extension that must be enabled in the shader to support // derivatives. If nullptr is returned then no extension needs to be enabled. Before calling // this function, the caller should check that shaderDerivativeSupport exists. @@ -289,6 +291,7 @@ private: bool fAtan2ImplementedAsAtanYOverX : 1; bool fRequiresLocalOutputColorForFBFetch : 1; bool fMustImplementGSInvocationsWithLoop : 1; + bool fMustObfuscateUniformColor : 1; PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; |