diff options
author | 2017-04-03 14:00:52 +0000 | |
---|---|---|
committer | 2017-04-03 14:34:21 +0000 | |
commit | dffe9827b18444d1426859d9035f9f0087201f44 (patch) | |
tree | 39742c71c9a0373035e8c0c00b27ec6c56253ffa /src/gpu/glsl | |
parent | 84c009f69216bc9f741294f24d60434383385f4c (diff) |
Revert "Revert "Revert "Allow FPs to elevate default precision for the entire fragment program"""
This reverts commit ec53c636b781830cb6146bb32106d4ee44651fcc.
Reason for revert: Mali GMs look bad.
Original change's description:
> Revert "Revert "Allow FPs to elevate default precision for the entire fragment program""
>
> This reverts commit 903c3f70400462e191ccbca63393b2df3fe2dd11.
>
> Reason for revert: Vulkan issue fixed in compiler.
>
> Original change's description:
> > Revert "Allow FPs to elevate default precision for the entire fragment program"
> >
> > This reverts commit 92d7ccafdf896cf19764e025873d13315a76842d.
> >
> > Reason for revert: Vulkan errors.
> >
> > Original change's description:
> > > Allow FPs to elevate default precision for the entire fragment program
> > >
> > > Currently, GrConfigConversionEffect is able to round-trip on many mobile
> > > GPUs because it uses highp for all intermediate variables (including the
> > > texture fetch result). Separating the texture sample into a different
> > > processor breaks that.
> > >
> > > This is a blunt instrument, not to be used lightly.
> > >
> > > Bug: skia:
> > > Change-Id: I2ab365e3da79628069e2eb727c43c2bf45bfd789
> > > Reviewed-on: https://skia-review.googlesource.com/10162
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Brian Osman <brianosman@google.com>
> > >
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,ethannicholas@google.com,reviews@skia.org
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> >
> > Change-Id: Iee5bb409f86a9cabecc76bd1273a5b3cef6af179
> > Reviewed-on: https://skia-review.googlesource.com/10967
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> >
>
> TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,ethannicholas@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I733a0ecc40b58d8727f0259b5498c8e6610cedce
> Reviewed-on: https://skia-review.googlesource.com/11010
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
>
TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ic3274a0a8b776e811354c3441391ffdc80678292
Reviewed-on: https://skia-review.googlesource.com/11061
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/glsl')
-rw-r--r-- | src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp | 9 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLFragmentShaderBuilder.h | 23 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLVarying.cpp | 2 |
3 files changed, 10 insertions, 24 deletions
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp index 484bd78211..a1f5173436 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp @@ -85,8 +85,7 @@ GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* p , fCustomColorOutputIndex(-1) , fHasSecondaryOutput(false) , fUsedSampleOffsetArrays(0) - , fHasInitializedSampleMask(false) - , fDefaultPrecision(kMedium_GrSLPrecision) { + , fHasInitializedSampleMask(false) { fSubstageIndices.push_back(0); #ifdef SK_DEBUG fUsedProcessorFeatures = GrProcessor::kNone_RequiredFeatures; @@ -179,10 +178,6 @@ void GrGLSLFragmentShaderBuilder::overrideSampleCoverage(const char* mask) { fHasInitializedSampleMask = true; } -void GrGLSLFragmentShaderBuilder::elevateDefaultPrecision(GrSLPrecision precision) { - fDefaultPrecision = SkTMax(fDefaultPrecision, precision); -} - const char* GrGLSLFragmentShaderBuilder::dstColor() { SkDEBUGCODE(fHasReadDstColor = true;) @@ -284,7 +279,7 @@ GrSurfaceOrigin GrGLSLFragmentShaderBuilder::getSurfaceOrigin() const { void GrGLSLFragmentShaderBuilder::onFinalize() { fProgramBuilder->varyingHandler()->getFragDecls(&this->inputs(), &this->outputs()); - GrGLSLAppendDefaultFloatPrecisionDeclaration(fDefaultPrecision, + GrGLSLAppendDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision, *fProgramBuilder->shaderCaps(), &this->precisionQualifier()); if (fUsedSampleOffsetArrays & (1 << kSkiaDevice_Coordinates)) { diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h index 65bcb8dae6..764f3bd812 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h @@ -94,13 +94,6 @@ public: virtual const char* distanceVectorName() const = 0; /** - * Overrides the default precision for the entire fragment program. Processors that require - * high precision input (eg from incoming texture samples) may use this. For calculations that - * are limited to a single processor's code, it is better to annotate individual declarations. - */ - virtual void elevateDefaultPrecision(GrSLPrecision) = 0; - - /** * Fragment procs with child procs should call these functions before/after calling emitCode * on a child proc. */ @@ -174,7 +167,6 @@ public: void appendOffsetToSample(const char* sampleIdx, Coordinates) override; void maskSampleCoverage(const char* mask, bool invert = false) override; void overrideSampleCoverage(const char* mask) override; - void elevateDefaultPrecision(GrSLPrecision) override; const SkString& getMangleString() const override { return fMangleString; } void onBeforeChildProcEmitCode() override; void onAfterChildProcEmitCode() override; @@ -233,14 +225,13 @@ private: */ SkString fMangleString; - bool fSetupFragPosition; - bool fHasCustomColorOutput; - int fCustomColorOutputIndex; - bool fHasSecondaryOutput; - uint8_t fUsedSampleOffsetArrays; - bool fHasInitializedSampleMask; - SkString fDistanceVectorOutput; - GrSLPrecision fDefaultPrecision; + bool fSetupFragPosition; + bool fHasCustomColorOutput; + int fCustomColorOutputIndex; + bool fHasSecondaryOutput; + uint8_t fUsedSampleOffsetArrays; + bool fHasInitializedSampleMask; + SkString fDistanceVectorOutput; #ifdef SK_DEBUG // some state to verify shaders and effects are consistent, this is reset between effects by diff --git a/src/gpu/glsl/GrGLSLVarying.cpp b/src/gpu/glsl/GrGLSLVarying.cpp index ef3fe8af23..7d841f5417 100644 --- a/src/gpu/glsl/GrGLSLVarying.cpp +++ b/src/gpu/glsl/GrGLSLVarying.cpp @@ -42,7 +42,7 @@ void GrGLSLVaryingHandler::internalAddVarying(const char* name, SkASSERT(varying); v.fType = varying->fType; - v.fPrecision = (kDefault_GrSLPrecision == precision) ? kMedium_GrSLPrecision : precision; + v.fPrecision = precision; v.fIsFlat = flat; fProgramBuilder->nameVariable(&v.fVsOut, 'v', name); v.fVisibility = kNone_GrShaderFlags; |