aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-07 14:22:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-07 14:22:45 -0700
commit131ff13f66582204a965c7f56557dc4d0d1a3d33 (patch)
treea719b65a50a950afe1617f65e59e8b5d81a98f92 /src
parentd94ad5823b7da7f115e997d12828314e290981f6 (diff)
Switch to a whitelist for manual mip-map generation
Due to performance regression on various GPUs, we're only going to use the new draw-call based mip-mapper when necessary. Of the bots where we have test coverage, that means Intel and Mac-NVIDIA. We also had failures on our AMD 7770 bots - I'm upgrading the drivers on those two machines, and I'm leaving them out of the whitelist for now. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2042313002 Review-Url: https://codereview.chromium.org/2042313002
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp13
-rw-r--r--src/gpu/gl/GrGLUtil.cpp3
-rw-r--r--src/gpu/gl/GrGLUtil.h1
3 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 14c03d70a7..260521187a 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -546,13 +546,14 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
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.
- // At least some Mali chips (T604 in Nexus10) produces incorrect (wrt sRGB) mips using draws
+ // We support manual mip-map generation (via iterative downsampling draw calls). This fixes
+ // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textures when using
+ // glGenerateMipmap. Our implementation requires mip-level sampling control. Additionally,
+ // it can be much slower (especially on mobile GPUs), so we opt-in only when necessary:
if (fMipMapLevelAndLodControlSupport &&
- kAdreno3xx_GrGLRenderer != ctxInfo.renderer() &&
- kARM_GrGLVendor != ctxInfo.vendor()) {
+ ((kIntel_GrGLVendor == ctxInfo.vendor()) ||
+ (kNVIDIA_GrGLDriver == ctxInfo.driver() && isMAC) ||
+ (kATI_GrGLVendor == ctxInfo.vendor()))) {
fDoManualMipmapping = true;
}
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index ecc587b714..490e501051 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -252,6 +252,9 @@ GrGLVendor GrGLGetVendorFromString(const char* vendorString) {
if (0 == strcmp(vendorString, "NVIDIA Corporation")) {
return kNVIDIA_GrGLVendor;
}
+ if (0 == strcmp(vendorString, "ATI Technologies Inc.")) {
+ return kATI_GrGLVendor;
+ }
}
return kOther_GrGLVendor;
}
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index 98f738b091..b7c17d3867 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -40,6 +40,7 @@ enum GrGLVendor {
kIntel_GrGLVendor,
kQualcomm_GrGLVendor,
kNVIDIA_GrGLVendor,
+ kATI_GrGLVendor,
kOther_GrGLVendor
};