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

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: Rebase Created 5 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
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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { 693 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) {
694 694
695 fMSFBOType = kNone_MSFBOType; 695 fMSFBOType = kNone_MSFBOType;
696 if (kGL_GrGLStandard != ctxInfo.standard()) { 696 if (kGL_GrGLStandard != ctxInfo.standard()) {
697 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed 697 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed
698 // ES3 driver bugs on at least one device with a tiled GPU (N10). 698 // ES3 driver bugs on at least one device with a tiled GPU (N10).
699 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { 699 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) {
700 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; 700 fMSFBOType = kES_EXT_MsToTexture_MSFBOType;
701 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) { 701 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) {
702 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; 702 fMSFBOType = kES_IMG_MsToTexture_MSFBOType;
703 } else if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") &&
704 ctxInfo.hasExtension("GL_NV_path_rendering")) {
705 fMSFBOType = kMixedSamples_MSFBOType;
Chris Dalton 2015/06/09 17:39:51 So when I made the mixed samples support depend on
703 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { 706 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) {
704 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; 707 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType;
705 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { 708 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) {
706 // chrome's extension is equivalent to the EXT msaa 709 // chrome's extension is equivalent to the EXT msaa
707 // and fbo_blit extensions. 710 // and fbo_blit extensions.
708 fMSFBOType = kDesktop_EXT_MSFBOType; 711 fMSFBOType = kDesktop_EXT_MSFBOType;
709 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { 712 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) {
710 fMSFBOType = kES_Apple_MSFBOType; 713 fMSFBOType = kES_Apple_MSFBOType;
711 } 714 }
712 } else { 715 } else {
713 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || 716 if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") &&
717 ctxInfo.hasExtension("GL_NV_path_rendering")) {
718 fMSFBOType = kMixedSamples_MSFBOType;
Chris Dalton 2015/06/09 17:39:51 Ditto
719 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) ||
714 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { 720 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
715 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; 721 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType;
716 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && 722 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") &&
717 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { 723 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
718 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; 724 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType;
719 } 725 }
720 } 726 }
721 } 727 }
722 728
723 namespace { 729 namespace {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 } 842 }
837 843
838 static const char* kMSFBOExtStr[] = { 844 static const char* kMSFBOExtStr[] = {
839 "None", 845 "None",
840 "ARB", 846 "ARB",
841 "EXT", 847 "EXT",
842 "ES 3.0", 848 "ES 3.0",
843 "Apple", 849 "Apple",
844 "IMG MS To Texture", 850 "IMG MS To Texture",
845 "EXT MS To Texture", 851 "EXT MS To Texture",
852 "MixedSamples",
846 }; 853 };
847 GR_STATIC_ASSERT(0 == kNone_MSFBOType); 854 GR_STATIC_ASSERT(0 == kNone_MSFBOType);
848 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); 855 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType);
849 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); 856 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType);
850 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); 857 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType);
851 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); 858 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType);
852 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); 859 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType);
853 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); 860 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType);
861 GR_STATIC_ASSERT(7 == kMixedSamples_MSFBOType);
854 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); 862 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1);
855 863
856 static const char* kInvalidateFBTypeStr[] = { 864 static const char* kInvalidateFBTypeStr[] = {
857 "None", 865 "None",
858 "Discard", 866 "Discard",
859 "Invalidate", 867 "Invalidate",
860 }; 868 };
861 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); 869 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType);
862 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); 870 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType);
863 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); 871 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType);
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 if (fGeometryShaderSupport) { 1130 if (fGeometryShaderSupport) {
1123 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 1131 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
1124 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; 1132 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p];
1125 } 1133 }
1126 } 1134 }
1127 } 1135 }
1128 1136
1129 1137
1130 1138
1131 1139
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698