Turn it off on Adreno3xx devices, because the small-render-target bug on
those devices leads to empty mipmaps for the smallest mips.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=
2026393004
Review-Url: https://codereview.chromium.org/
2026393004
fPartialFBOReadIsSlow = false;
fMipMapLevelAndLodControlSupport = false;
fRGBAToBGRAReadbackConversionsAreSlow = false;
+ fDoManualMipmapping = false;
fBlitFramebufferSupport = kNone_BlitFramebufferSupport;
fSampleShadingSupport = true;
}
+ // Manual mip-mapping requires mip-level sampling control.
+ // Additionally, Adreno330 will produce empty mip-maps for the very smallest mips with
+ // our manual (draw-call) implementation.
+ if (fMipMapLevelAndLodControlSupport &&
+ kAdreno3xx_GrGLRenderer != ctxInfo.renderer()) {
+ fDoManualMipmapping = true;
+ }
+
// Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES compatibility have
// already been detected.
this->initConfigTable(ctxInfo, gli, glslCaps);
bool mipMapLevelAndLodControlSupport() const { return fMipMapLevelAndLodControlSupport; }
+ bool doManualMipmapping() const { return fDoManualMipmapping; }
+
/**
* Returns a string containing the caps info.
*/
bool fTextureSwizzleSupport : 1;
bool fMipMapLevelAndLodControlSupport : 1;
bool fRGBAToBGRAReadbackConversionsAreSlow : 1;
+ bool fDoManualMipmapping : 1;
BlitFramebufferSupport fBlitFramebufferSupport;
return true;
}
-bool gManualMipmaps = true;
-
// Manual implementation of mipmap generation, to work around driver bugs w/sRGB.
// Uses draw calls to do a series of downsample operations to successive mips.
// If this returns false, then the calling code falls back to using glGenerateMipmap.
bool GrGLGpu::generateMipmap(GrGLTexture* texture, bool gammaCorrect) {
- // Global switch for manual mipmap generation:
- if (!gManualMipmaps) {
+ // Our iterative downsample requires the ability to limit which level we're sampling:
+ if (!this->glCaps().doManualMipmapping()) {
return false;
}
return false;
}
- // Our iterative downsample requires the ability to limit which level we're sampling:
- if (!this->glCaps().mipMapLevelAndLodControlSupport()) {
- return false;
- }
-
// If we're mipping an sRGB texture, we need to ensure FB sRGB is correct:
if (GrPixelConfigIsSRGB(texture->config())) {
// If we have write-control, just set the state that we want: