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

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

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: GrProcOptInfo bug Created 5 years, 9 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
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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { 765 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) {
766 766
767 fMSFBOType = kNone_MSFBOType; 767 fMSFBOType = kNone_MSFBOType;
768 if (kGL_GrGLStandard != ctxInfo.standard()) { 768 if (kGL_GrGLStandard != ctxInfo.standard()) {
769 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed 769 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed
770 // ES3 driver bugs on at least one device with a tiled GPU (N10). 770 // ES3 driver bugs on at least one device with a tiled GPU (N10).
771 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { 771 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) {
772 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; 772 fMSFBOType = kES_EXT_MsToTexture_MSFBOType;
773 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) { 773 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) {
774 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; 774 fMSFBOType = kES_IMG_MsToTexture_MSFBOType;
775 } else if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples")) {
776 fMSFBOType = kStencil_MSFBOType;
775 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { 777 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) {
776 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; 778 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType;
777 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { 779 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) {
778 // chrome's extension is equivalent to the EXT msaa 780 // chrome's extension is equivalent to the EXT msaa
779 // and fbo_blit extensions. 781 // and fbo_blit extensions.
780 fMSFBOType = kDesktop_EXT_MSFBOType; 782 fMSFBOType = kDesktop_EXT_MSFBOType;
781 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { 783 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) {
782 fMSFBOType = kES_Apple_MSFBOType; 784 fMSFBOType = kES_Apple_MSFBOType;
783 } 785 }
784 } else { 786 } else {
785 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || 787 if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples")) {
788 fMSFBOType = kStencil_MSFBOType;
789 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) ||
786 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { 790 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
787 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; 791 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType;
788 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && 792 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") &&
789 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { 793 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
790 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; 794 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType;
791 } 795 }
792 } 796 }
793 } 797 }
794 798
795 namespace { 799 namespace {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 } 991 }
988 992
989 static const char* kMSFBOExtStr[] = { 993 static const char* kMSFBOExtStr[] = {
990 "None", 994 "None",
991 "ARB", 995 "ARB",
992 "EXT", 996 "EXT",
993 "ES 3.0", 997 "ES 3.0",
994 "Apple", 998 "Apple",
995 "IMG MS To Texture", 999 "IMG MS To Texture",
996 "EXT MS To Texture", 1000 "EXT MS To Texture",
1001 "Stencil",
997 }; 1002 };
998 GR_STATIC_ASSERT(0 == kNone_MSFBOType); 1003 GR_STATIC_ASSERT(0 == kNone_MSFBOType);
999 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); 1004 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType);
1000 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); 1005 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType);
1001 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); 1006 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType);
1002 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); 1007 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType);
1003 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); 1008 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType);
1004 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); 1009 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType);
1010 GR_STATIC_ASSERT(7 == kStencil_MSFBOType);
1005 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); 1011 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1);
1006 1012
1007 static const char* kInvalidateFBTypeStr[] = { 1013 static const char* kInvalidateFBTypeStr[] = {
1008 "None", 1014 "None",
1009 "Discard", 1015 "Discard",
1010 "Invalidate", 1016 "Invalidate",
1011 }; 1017 };
1012 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); 1018 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType);
1013 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); 1019 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType);
1014 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); 1020 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 1058 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
1053 r.appendf("Fragment coord conventions support: %s\n", 1059 r.appendf("Fragment coord conventions support: %s\n",
1054 (fFragCoordsConventionSupport ? "YES": "NO")); 1060 (fFragCoordsConventionSupport ? "YES": "NO"));
1055 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 1061 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
1056 r.appendf("Use non-VBO for dynamic data: %s\n", 1062 r.appendf("Use non-VBO for dynamic data: %s\n",
1057 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 1063 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
1058 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); 1064 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO "));
1059 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); 1065 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
1060 return r; 1066 return r;
1061 } 1067 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698