Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 2042313002: Switch to a whitelist for manual mip-map generation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add ATI to whitelist Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLUtil.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 10
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 539
540 if (kGL_GrGLStandard == standard) { 540 if (kGL_GrGLStandard == standard) {
541 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s hading")) && 541 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s hading")) &&
542 ctxInfo.vendor() != kIntel_GrGLVendor) { 542 ctxInfo.vendor() != kIntel_GrGLVendor) {
543 fSampleShadingSupport = true; 543 fSampleShadingSupport = true;
544 } 544 }
545 } else if (ctxInfo.hasExtension("GL_OES_sample_shading")) { 545 } else if (ctxInfo.hasExtension("GL_OES_sample_shading")) {
546 fSampleShadingSupport = true; 546 fSampleShadingSupport = true;
547 } 547 }
548 548
549 // Manual mip-mapping requires mip-level sampling control. 549 // We support manual mip-map generation (via iterative downsampling draw cal ls). This fixes
550 // Additionally, Adreno330 will produce empty mip-maps for the very smallest mips with 550 // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textu res when using
551 // our manual (draw-call) implementation. 551 // glGenerateMipmap. Our implementation requires mip-level sampling control. Additionally,
552 // At least some Mali chips (T604 in Nexus10) produces incorrect (wrt sRGB) mips using draws 552 // it can be much slower (especially on mobile GPUs), so we opt-in only when necessary:
553 if (fMipMapLevelAndLodControlSupport && 553 if (fMipMapLevelAndLodControlSupport &&
554 kAdreno3xx_GrGLRenderer != ctxInfo.renderer() && 554 ((kIntel_GrGLVendor == ctxInfo.vendor()) ||
555 kARM_GrGLVendor != ctxInfo.vendor()) { 555 (kNVIDIA_GrGLDriver == ctxInfo.driver() && isMAC) ||
556 (kATI_GrGLVendor == ctxInfo.vendor()))) {
556 fDoManualMipmapping = true; 557 fDoManualMipmapping = true;
557 } 558 }
558 559
559 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com patibility have 560 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com patibility have
560 // already been detected. 561 // already been detected.
561 this->initConfigTable(ctxInfo, gli, glslCaps); 562 this->initConfigTable(ctxInfo, gli, glslCaps);
562 563
563 this->applyOptionsOverrides(contextOptions); 564 this->applyOptionsOverrides(contextOptions);
564 glslCaps->applyOptionsOverrides(contextOptions); 565 glslCaps->applyOptionsOverrides(contextOptions);
565 } 566 }
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1924 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1924 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1925 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1925 fConfigTable[i].fFormats.fExternalFormat[j]); 1926 fConfigTable[i].fFormats.fExternalFormat[j]);
1926 } 1927 }
1927 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1928 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1928 } 1929 }
1929 #endif 1930 #endif
1930 } 1931 }
1931 1932
1932 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1933 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698