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 #include "GrGLContext.h" | 10 #include "GrGLContext.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 fImagingSupport = kGL_GrGLStandard == standard && | 194 fImagingSupport = kGL_GrGLStandard == standard && |
195 ctxInfo.hasExtension("GL_ARB_imaging"); | 195 ctxInfo.hasExtension("GL_ARB_imaging"); |
196 | 196 |
197 // ES 2 only guarantees RGBA/uchar + one other format/type combo for | 197 // ES 2 only guarantees RGBA/uchar + one other format/type combo for |
198 // ReadPixels. The other format has to checked at run-time since it | 198 // ReadPixels. The other format has to checked at run-time since it |
199 // can change based on which render target is bound | 199 // can change based on which render target is bound |
200 fTwoFormatLimit = kGLES_GrGLStandard == standard; | 200 fTwoFormatLimit = kGLES_GrGLStandard == standard; |
201 | 201 |
| 202 // Frag Coords Convention support is not part of ES |
202 // Known issue on at least some Intel platforms: | 203 // Known issue on at least some Intel platforms: |
203 // http://code.google.com/p/skia/issues/detail?id=946 | 204 // http://code.google.com/p/skia/issues/detail?id=946 |
204 if (kIntel_GrGLVendor != ctxInfo.vendor()) { | 205 if (kIntel_GrGLVendor != ctxInfo.vendor() && kGLES_GrGLStandard != standard)
{ |
205 fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGe
neration || | 206 fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGe
neration || |
206 ctxInfo.hasExtension("GL_ARB_fragment_coo
rd_conventions"); | 207 ctxInfo.hasExtension("GL_ARB_fragment_coo
rd_conventions"); |
207 } | 208 } |
208 | 209 |
209 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with | 210 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with |
210 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex | 211 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex |
211 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and | 212 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and |
212 // limit this decision to specific GPU families rather than basing it on the
vendor alone. | 213 // limit this decision to specific GPU families rather than basing it on the
vendor alone. |
213 if (!GR_GL_MUST_USE_VBO && | 214 if (!GR_GL_MUST_USE_VBO && |
214 (kARM_GrGLVendor == ctxInfo.vendor() || | 215 (kARM_GrGLVendor == ctxInfo.vendor() || |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 362 |
362 // Enable supported shader-related caps | 363 // Enable supported shader-related caps |
363 if (kGL_GrGLStandard == standard) { | 364 if (kGL_GrGLStandard == standard) { |
364 fDualSourceBlendingSupport = ctxInfo.version() >= GR_GL_VER(3,3) || | 365 fDualSourceBlendingSupport = ctxInfo.version() >= GR_GL_VER(3,3) || |
365 ctxInfo.hasExtension("GL_ARB_blend_func_ext
ended"); | 366 ctxInfo.hasExtension("GL_ARB_blend_func_ext
ended"); |
366 fShaderDerivativeSupport = true; | 367 fShaderDerivativeSupport = true; |
367 // we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS | 368 // we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS |
368 fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3,2) && | 369 fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3,2) && |
369 ctxInfo.glslGeneration() >= k150_GrGLSLGenerati
on; | 370 ctxInfo.glslGeneration() >= k150_GrGLSLGenerati
on; |
370 } else { | 371 } else { |
371 fShaderDerivativeSupport = ctxInfo.hasExtension("GL_OES_standard_derivat
ives"); | 372 fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0) || |
| 373 ctxInfo.hasExtension("GL_OES_standard_derivat
ives"); |
372 } | 374 } |
373 | 375 |
374 if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) { | 376 if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) { |
375 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxSampleCount); | 377 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxSampleCount); |
376 } else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) { | 378 } else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) { |
377 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxSampleCount); | 379 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxSampleCount); |
378 } | 380 } |
379 | 381 |
380 this->initConfigTexturableTable(ctxInfo, gli); | 382 this->initConfigTexturableTable(ctxInfo, gli); |
381 this->initConfigRenderableTable(ctxInfo); | 383 this->initConfigRenderableTable(ctxInfo); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 865 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
864 r.appendf("Fragment coord conventions support: %s\n", | 866 r.appendf("Fragment coord conventions support: %s\n", |
865 (fFragCoordsConventionSupport ? "YES": "NO")); | 867 (fFragCoordsConventionSupport ? "YES": "NO")); |
866 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 868 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
867 r.appendf("Use non-VBO for dynamic data: %s\n", | 869 r.appendf("Use non-VBO for dynamic data: %s\n", |
868 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 870 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
869 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 871 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
870 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 872 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
871 return r; | 873 return r; |
872 } | 874 } |
OLD | NEW |