Disable dithering on the PowerVR GE8320
FWIW, our PowerVRGE8320 reports that it has integer shader support. Bug: b/195281495 Change-Id: Ie969d8e978404a5b8963bb5c71dedfa8945b2a2e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436563 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
e53c721d78
commit
0e741e2dea
@ -83,6 +83,7 @@ GrCaps::GrCaps(const GrContextOptions& options) {
|
||||
fRequiresManualFBBarrierAfterTessellatedStencilDraw = false;
|
||||
fNativeDrawIndexedIndirectIsBroken = false;
|
||||
fAvoidReorderingRenderTasks = false;
|
||||
fAvoidDithering = false;
|
||||
|
||||
fPreferVRAMUseOverFlushes = true;
|
||||
|
||||
@ -250,6 +251,7 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
|
||||
writer->appendBool("Native draw indexed indirect is broken [workaround]",
|
||||
fNativeDrawIndexedIndirectIsBroken);
|
||||
writer->appendBool("Avoid DAG reordering [workaround]", fAvoidReorderingRenderTasks);
|
||||
writer->appendBool("Avoid Dithering [workaround]", fAvoidDithering);
|
||||
|
||||
if (this->advancedBlendEquationSupport()) {
|
||||
writer->appendHexU32("Advanced Blend Equation Disable Flags", fAdvBlendEqDisableFlags);
|
||||
|
@ -493,6 +493,10 @@ public:
|
||||
return fAvoidReorderingRenderTasks;
|
||||
}
|
||||
|
||||
bool avoidDithering() const {
|
||||
return fAvoidDithering;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the passed color type is renderable. If so, the same color type is passed
|
||||
* back along with the default format used for the color type. If not, provides an alternative
|
||||
@ -565,6 +569,7 @@ protected:
|
||||
bool fRequiresManualFBBarrierAfterTessellatedStencilDraw : 1;
|
||||
bool fNativeDrawIndexedIndirectIsBroken : 1;
|
||||
bool fAvoidReorderingRenderTasks : 1;
|
||||
bool fAvoidDithering : 1;
|
||||
|
||||
// ANGLE performance workaround
|
||||
bool fPreferVRAMUseOverFlushes : 1;
|
||||
|
@ -325,12 +325,16 @@ static inline float dither_range_for_config(GrColorType dstColorType) {
|
||||
}
|
||||
|
||||
static std::unique_ptr<GrFragmentProcessor> make_dither_effect(
|
||||
std::unique_ptr<GrFragmentProcessor> inputFP, float range, const GrShaderCaps* caps) {
|
||||
std::unique_ptr<GrFragmentProcessor> inputFP, float range, const GrCaps* caps) {
|
||||
if (range == 0 || inputFP == nullptr) {
|
||||
return inputFP;
|
||||
}
|
||||
|
||||
if (caps->integerSupport()) {
|
||||
if (caps->avoidDithering()) {
|
||||
return inputFP;
|
||||
}
|
||||
|
||||
if (caps->shaderCaps()->integerSupport()) {
|
||||
// This ordered-dither code is lifted from the cpu backend.
|
||||
static auto effect = SkMakeRuntimeEffect(SkRuntimeEffect::MakeForShader, R"(
|
||||
uniform half range;
|
||||
@ -500,7 +504,7 @@ static inline bool skpaint_to_grpaint_impl(GrRecordingContext* context,
|
||||
if (SkPaintPriv::ShouldDither(skPaint, GrColorTypeToSkColorType(ct)) && paintFP != nullptr) {
|
||||
float ditherRange = dither_range_for_config(ct);
|
||||
paintFP = make_dither_effect(
|
||||
std::move(paintFP), ditherRange, context->priv().caps()->shaderCaps());
|
||||
std::move(paintFP), ditherRange, context->priv().caps());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -758,6 +758,15 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
|
||||
fShouldCollapseSrcOverToSrcWhenAble = true;
|
||||
}
|
||||
|
||||
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
|
||||
if (ctxInfo.renderer() == GrGLRenderer::kPowerVRRogue) {
|
||||
// https://b/195281495
|
||||
// The TecnoSpark 3 Pro with a PowerVR GE8300 seems to have a steep dithering performance
|
||||
// cliff in the Android Framework
|
||||
fAvoidDithering = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
FormatWorkarounds formatWorkarounds;
|
||||
|
||||
if (!contextOptions.fDisableDriverCorrectnessWorkarounds) {
|
||||
|
Loading…
Reference in New Issue
Block a user