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

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

Powered by Google App Engine
This is Rietveld 408576698