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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 227 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
228 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); | 228 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); |
229 } else { | 229 } else { |
230 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 230 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
231 ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); | 231 ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); |
232 } | 232 } |
233 | 233 |
234 if (kGLES_GrGLStandard == standard) { | 234 if (kGLES_GrGLStandard == standard) { |
235 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 235 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
236 fFBFetchType = kEXT_FBFetchType; | 236 fFBFetchType = kEXT_FBFetchType; |
| 237 fFBFetchColorName = "gl_LastFragData[0]"; |
| 238 fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; |
237 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 239 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
238 fFBFetchType = kNV_FBFetchType; | 240 fFBFetchType = kNV_FBFetchType; |
| 241 fFBFetchColorName = "gl_LastFragData[0]"; |
| 242 fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; |
| 243 } else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) { |
| 244 // The arm extension requires specifically enabling MSAA fetching pe
r sample. |
| 245 // On some devices this may have a perf hit. Also multiple render t
argets are disabled |
| 246 GR_GL_CALL(gli, Enable(GR_GL_FETCH_PER_SAMPLE_ARM)); |
| 247 fFBFetchType = kARM_FBFetchType; |
| 248 fFBFetchColorName = "gl_LastFragColorARM"; |
| 249 fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; |
239 } | 250 } |
240 } | 251 } |
241 | 252 |
242 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader | 253 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader |
243 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); | 254 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); |
244 | 255 |
245 this->initFSAASupport(ctxInfo, gli); | 256 this->initFSAASupport(ctxInfo, gli); |
246 this->initStencilFormats(ctxInfo); | 257 this->initStencilFormats(ctxInfo); |
247 | 258 |
248 /************************************************************************** | 259 /************************************************************************** |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); | 783 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); |
773 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); | 784 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); |
774 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); | 785 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); |
775 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); | 786 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); |
776 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); | 787 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); |
777 | 788 |
778 static const char* kFBFetchTypeStr[] = { | 789 static const char* kFBFetchTypeStr[] = { |
779 "None", | 790 "None", |
780 "EXT", | 791 "EXT", |
781 "NV", | 792 "NV", |
| 793 "ARM", |
782 }; | 794 }; |
783 GR_STATIC_ASSERT(0 == kNone_FBFetchType); | 795 GR_STATIC_ASSERT(0 == kNone_FBFetchType); |
784 GR_STATIC_ASSERT(1 == kEXT_FBFetchType); | 796 GR_STATIC_ASSERT(1 == kEXT_FBFetchType); |
785 GR_STATIC_ASSERT(2 == kNV_FBFetchType); | 797 GR_STATIC_ASSERT(2 == kNV_FBFetchType); |
| 798 GR_STATIC_ASSERT(3 == kARM_FBFetchType); |
786 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFBFetchTypeStr) == kLast_FBFetchType + 1); | 799 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFBFetchTypeStr) == kLast_FBFetchType + 1); |
787 | 800 |
788 static const char* kInvalidateFBTypeStr[] = { | 801 static const char* kInvalidateFBTypeStr[] = { |
789 "None", | 802 "None", |
790 "Discard", | 803 "Discard", |
791 "Invalidate", | 804 "Invalidate", |
792 }; | 805 }; |
793 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); | 806 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); |
794 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); | 807 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); |
795 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); | 808 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 846 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
834 r.appendf("Fragment coord conventions support: %s\n", | 847 r.appendf("Fragment coord conventions support: %s\n", |
835 (fFragCoordsConventionSupport ? "YES": "NO")); | 848 (fFragCoordsConventionSupport ? "YES": "NO")); |
836 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 849 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
837 r.appendf("Use non-VBO for dynamic data: %s\n", | 850 r.appendf("Use non-VBO for dynamic data: %s\n", |
838 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 851 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
839 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 852 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
840 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 853 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
841 return r; | 854 return r; |
842 } | 855 } |
OLD | NEW |