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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 ctxInfo.hasExtension("GL_OES_vertex_array_ob ject"); | 230 ctxInfo.hasExtension("GL_OES_vertex_array_ob ject"); |
231 } | 231 } |
232 | 232 |
233 if (kGL_GrGLStandard == standard) { | 233 if (kGL_GrGLStandard == standard) { |
234 fES2CompatibilitySupport = ctxInfo.hasExtension("GL_ARB_ES2_compatibilit y"); | 234 fES2CompatibilitySupport = ctxInfo.hasExtension("GL_ARB_ES2_compatibilit y"); |
235 } | 235 } |
236 else { | 236 else { |
237 fES2CompatibilitySupport = true; | 237 fES2CompatibilitySupport = true; |
238 } | 238 } |
239 | 239 |
240 if (kGL_GrGLStandard == standard) { | 240 if (kGL_GrGLStandard == standard || fShaderCaps->mixedSamplesSupport()) { |
Chris Dalton
2015/06/11 23:34:38
This won't quite work. See below how mixed samples
| |
241 fMultisampleDisableSupport = true; | 241 fMultisampleDisableSupport = true; |
242 } else { | 242 } else { |
243 fMultisampleDisableSupport = false; | 243 fMultisampleDisableSupport = false; |
244 } | 244 } |
245 | 245 |
246 /************************************************************************** | 246 /************************************************************************** |
247 * GrShaderCaps fields | 247 * GrShaderCaps fields |
248 **************************************************************************/ | 248 **************************************************************************/ |
249 | 249 |
250 glslCaps->fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering "); | 250 glslCaps->fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering "); |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
782 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { | 782 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { |
783 | 783 |
784 fMSFBOType = kNone_MSFBOType; | 784 fMSFBOType = kNone_MSFBOType; |
785 if (kGL_GrGLStandard != ctxInfo.standard()) { | 785 if (kGL_GrGLStandard != ctxInfo.standard()) { |
786 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed | 786 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed |
787 // ES3 driver bugs on at least one device with a tiled GPU (N10). | 787 // ES3 driver bugs on at least one device with a tiled GPU (N10). |
788 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { | 788 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { |
789 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; | 789 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; |
790 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) { | 790 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) { |
791 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; | 791 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; |
792 } else if (fShaderCaps->mixedSamplesSupport() && fShaderCaps->pathRender ingSupport()) { | |
793 fMSFBOType = kMixedSamples_MSFBOType; | |
792 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { | 794 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
793 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; | 795 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; |
794 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { | 796 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { |
795 // chrome's extension is equivalent to the EXT msaa | 797 // chrome's extension is equivalent to the EXT msaa |
796 // and fbo_blit extensions. | 798 // and fbo_blit extensions. |
797 fMSFBOType = kDesktop_EXT_MSFBOType; | 799 fMSFBOType = kDesktop_EXT_MSFBOType; |
798 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { | 800 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { |
799 fMSFBOType = kES_Apple_MSFBOType; | 801 fMSFBOType = kES_Apple_MSFBOType; |
800 } | 802 } |
801 } else { | 803 } else { |
802 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | 804 if (fShaderCaps->mixedSamplesSupport() && fShaderCaps->pathRenderingSupp ort()) { |
805 fMSFBOType = kMixedSamples_MSFBOType; | |
806 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | |
803 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { | 807 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { |
804 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; | 808 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; |
805 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && | 809 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && |
806 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { | 810 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { |
807 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; | 811 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; |
808 } | 812 } |
809 } | 813 } |
810 } | 814 } |
811 | 815 |
812 namespace { | 816 namespace { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
925 } | 929 } |
926 | 930 |
927 static const char* kMSFBOExtStr[] = { | 931 static const char* kMSFBOExtStr[] = { |
928 "None", | 932 "None", |
929 "ARB", | 933 "ARB", |
930 "EXT", | 934 "EXT", |
931 "ES 3.0", | 935 "ES 3.0", |
932 "Apple", | 936 "Apple", |
933 "IMG MS To Texture", | 937 "IMG MS To Texture", |
934 "EXT MS To Texture", | 938 "EXT MS To Texture", |
939 "MixedSamples", | |
935 }; | 940 }; |
936 GR_STATIC_ASSERT(0 == kNone_MSFBOType); | 941 GR_STATIC_ASSERT(0 == kNone_MSFBOType); |
937 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); | 942 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); |
938 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); | 943 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); |
939 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); | 944 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); |
940 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); | 945 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); |
941 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); | 946 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); |
942 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); | 947 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); |
948 GR_STATIC_ASSERT(7 == kMixedSamples_MSFBOType); | |
943 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); | 949 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); |
944 | 950 |
945 static const char* kInvalidateFBTypeStr[] = { | 951 static const char* kInvalidateFBTypeStr[] = { |
946 "None", | 952 "None", |
947 "Discard", | 953 "Discard", |
948 "Invalidate", | 954 "Invalidate", |
949 }; | 955 }; |
950 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); | 956 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); |
951 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); | 957 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); |
952 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); | 958 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1109 if (fGeometryShaderSupport) { | 1115 if (fGeometryShaderSupport) { |
1110 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1116 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
1111 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; | 1117 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; |
1112 } | 1118 } |
1113 } | 1119 } |
1114 } | 1120 } |
1115 | 1121 |
1116 | 1122 |
1117 | 1123 |
1118 | 1124 |
OLD | NEW |