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 27 matching lines...) Expand all Loading... |
38 fTextureUsageSupport = false; | 38 fTextureUsageSupport = false; |
39 fTexStorageSupport = false; | 39 fTexStorageSupport = false; |
40 fTextureRedSupport = false; | 40 fTextureRedSupport = false; |
41 fImagingSupport = false; | 41 fImagingSupport = false; |
42 fTwoFormatLimit = false; | 42 fTwoFormatLimit = false; |
43 fFragCoordsConventionSupport = false; | 43 fFragCoordsConventionSupport = false; |
44 fVertexArrayObjectSupport = false; | 44 fVertexArrayObjectSupport = false; |
45 fUseNonVBOVertexAndIndexDynamicData = false; | 45 fUseNonVBOVertexAndIndexDynamicData = false; |
46 fIsCoreProfile = false; | 46 fIsCoreProfile = false; |
47 fFixedFunctionSupport = false; | 47 fFixedFunctionSupport = false; |
48 fDiscardFBSupport = false; | |
49 fFullClearIsFree = false; | 48 fFullClearIsFree = false; |
50 } | 49 } |
51 | 50 |
52 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { | 51 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
53 *this = caps; | 52 *this = caps; |
54 } | 53 } |
55 | 54 |
56 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 55 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
57 INHERITED::operator=(caps); | 56 INHERITED::operator=(caps); |
58 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 57 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
(...skipping 16 matching lines...) Expand all Loading... |
75 fTextureUsageSupport = caps.fTextureUsageSupport; | 74 fTextureUsageSupport = caps.fTextureUsageSupport; |
76 fTexStorageSupport = caps.fTexStorageSupport; | 75 fTexStorageSupport = caps.fTexStorageSupport; |
77 fTextureRedSupport = caps.fTextureRedSupport; | 76 fTextureRedSupport = caps.fTextureRedSupport; |
78 fImagingSupport = caps.fImagingSupport; | 77 fImagingSupport = caps.fImagingSupport; |
79 fTwoFormatLimit = caps.fTwoFormatLimit; | 78 fTwoFormatLimit = caps.fTwoFormatLimit; |
80 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 79 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
81 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 80 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
82 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 81 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
83 fIsCoreProfile = caps.fIsCoreProfile; | 82 fIsCoreProfile = caps.fIsCoreProfile; |
84 fFixedFunctionSupport = caps.fFixedFunctionSupport; | 83 fFixedFunctionSupport = caps.fFixedFunctionSupport; |
85 fDiscardFBSupport = caps.fDiscardFBSupport; | |
86 fFullClearIsFree = caps.fFullClearIsFree; | 84 fFullClearIsFree = caps.fFullClearIsFree; |
87 | 85 |
88 return *this; | 86 return *this; |
89 } | 87 } |
90 | 88 |
91 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 89 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
92 | 90 |
93 this->reset(); | 91 this->reset(); |
94 if (!ctxInfo.isInitialized()) { | 92 if (!ctxInfo.isInitialized()) { |
95 return; | 93 return; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 213 |
216 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with | 214 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with |
217 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex | 215 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex |
218 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and | 216 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and |
219 // limit this decision to specific GPU families rather than basing it on the
vendor alone. | 217 // limit this decision to specific GPU families rather than basing it on the
vendor alone. |
220 if (!GR_GL_MUST_USE_VBO && | 218 if (!GR_GL_MUST_USE_VBO && |
221 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { | 219 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { |
222 fUseNonVBOVertexAndIndexDynamicData = true; | 220 fUseNonVBOVertexAndIndexDynamicData = true; |
223 } | 221 } |
224 | 222 |
225 fDiscardFBSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuffer"); | 223 fDiscardRenderTargetSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuff
er"); |
226 | 224 |
227 if (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInf
o.vendor()) { | 225 if (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInf
o.vendor()) { |
228 fFullClearIsFree = true; | 226 fFullClearIsFree = true; |
229 } | 227 } |
230 | 228 |
231 if (kGL_GrGLStandard == standard) { | 229 if (kGL_GrGLStandard == standard) { |
232 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 230 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
233 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); | 231 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); |
234 } else { | 232 } else { |
235 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 233 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO"
)); | 650 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO"
)); |
653 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO"
)); | 651 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO"
)); |
654 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 652 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
655 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 653 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
656 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 654 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
657 r.appendf("Fragment coord conventions support: %s\n", | 655 r.appendf("Fragment coord conventions support: %s\n", |
658 (fFragCoordsConventionSupport ? "YES": "NO")); | 656 (fFragCoordsConventionSupport ? "YES": "NO")); |
659 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 657 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
660 r.appendf("Use non-VBO for dynamic data: %s\n", | 658 r.appendf("Use non-VBO for dynamic data: %s\n", |
661 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 659 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
662 r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" :
"NO")); | |
663 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 660 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
664 return r; | 661 return r; |
665 } | 662 } |
OLD | NEW |