OLD | NEW |
---|---|
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 Loading... | |
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 (fShaderCaps->mixedSamplesSupport() && fShaderCaps->pathRender ingSupport()) { | |
vbuzinov
2015/06/10 11:23:27
Currently crashes here due to uninitialized fShade
bsalomon
2015/06/10 19:57:07
Is it possible to just make the shader caps be ini
Chris Dalton
2015/06/10 20:55:56
It's not wrong, just not very useful without path
| |
704 fMSFBOType = kMixedSamples_MSFBOType; | |
703 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { | 705 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
704 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; | 706 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; |
705 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { | 707 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { |
706 // chrome's extension is equivalent to the EXT msaa | 708 // chrome's extension is equivalent to the EXT msaa |
707 // and fbo_blit extensions. | 709 // and fbo_blit extensions. |
708 fMSFBOType = kDesktop_EXT_MSFBOType; | 710 fMSFBOType = kDesktop_EXT_MSFBOType; |
709 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { | 711 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { |
710 fMSFBOType = kES_Apple_MSFBOType; | 712 fMSFBOType = kES_Apple_MSFBOType; |
711 } | 713 } |
712 } else { | 714 } else { |
713 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | 715 if (fShaderCaps->mixedSamplesSupport() && fShaderCaps->pathRenderingSupp ort()) { |
716 fMSFBOType = kMixedSamples_MSFBOType; | |
717 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | |
714 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { | 718 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { |
715 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; | 719 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; |
716 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && | 720 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && |
717 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { | 721 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { |
718 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; | 722 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; |
719 } | 723 } |
720 } | 724 } |
721 } | 725 } |
722 | 726 |
723 namespace { | 727 namespace { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
836 } | 840 } |
837 | 841 |
838 static const char* kMSFBOExtStr[] = { | 842 static const char* kMSFBOExtStr[] = { |
839 "None", | 843 "None", |
840 "ARB", | 844 "ARB", |
841 "EXT", | 845 "EXT", |
842 "ES 3.0", | 846 "ES 3.0", |
843 "Apple", | 847 "Apple", |
844 "IMG MS To Texture", | 848 "IMG MS To Texture", |
845 "EXT MS To Texture", | 849 "EXT MS To Texture", |
850 "MixedSamples", | |
846 }; | 851 }; |
847 GR_STATIC_ASSERT(0 == kNone_MSFBOType); | 852 GR_STATIC_ASSERT(0 == kNone_MSFBOType); |
848 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); | 853 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); |
849 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); | 854 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); |
850 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); | 855 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); |
851 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); | 856 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); |
852 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); | 857 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); |
853 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); | 858 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); |
859 GR_STATIC_ASSERT(7 == kMixedSamples_MSFBOType); | |
854 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); | 860 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); |
855 | 861 |
856 static const char* kInvalidateFBTypeStr[] = { | 862 static const char* kInvalidateFBTypeStr[] = { |
857 "None", | 863 "None", |
858 "Discard", | 864 "Discard", |
859 "Invalidate", | 865 "Invalidate", |
860 }; | 866 }; |
861 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); | 867 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); |
862 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); | 868 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); |
863 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); | 869 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1122 if (fGeometryShaderSupport) { | 1128 if (fGeometryShaderSupport) { |
1123 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1129 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
1124 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; | 1130 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; |
1125 } | 1131 } |
1126 } | 1132 } |
1127 } | 1133 } |
1128 | 1134 |
1129 | 1135 |
1130 | 1136 |
1131 | 1137 |
OLD | NEW |