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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 return; | 94 return; |
95 } | 95 } |
96 | 96 |
97 GrGLBinding binding = ctxInfo.binding(); | 97 GrGLBinding binding = ctxInfo.binding(); |
98 GrGLVersion version = ctxInfo.version(); | 98 GrGLVersion version = ctxInfo.version(); |
99 | 99 |
100 /************************************************************************** | 100 /************************************************************************** |
101 * Caps specific to GrGLCaps | 101 * Caps specific to GrGLCaps |
102 **************************************************************************/ | 102 **************************************************************************/ |
103 | 103 |
104 if (kES2_GrGLBinding == binding) { | 104 if (kES_GrGLBinding == binding) { |
105 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS, | 105 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS, |
106 &fMaxFragmentUniformVectors); | 106 &fMaxFragmentUniformVectors); |
107 } else { | 107 } else { |
108 GrAssert(kDesktop_GrGLBinding == binding); | 108 GrAssert(kDesktop_GrGLBinding == binding); |
109 GrGLint max; | 109 GrGLint max; |
110 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); | 110 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); |
111 fMaxFragmentUniformVectors = max / 4; | 111 fMaxFragmentUniformVectors = max / 4; |
112 } | 112 } |
113 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); | 113 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); |
114 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn
its); | 114 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn
its); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 fPackFlipYSupport = false; | 148 fPackFlipYSupport = false; |
149 } else { | 149 } else { |
150 fUnpackRowLengthSupport =ctxInfo.hasExtension("GL_EXT_unpack_subimage"); | 150 fUnpackRowLengthSupport =ctxInfo.hasExtension("GL_EXT_unpack_subimage"); |
151 fUnpackFlipYSupport = ctxInfo.hasExtension("GL_CHROMIUM_flipy"); | 151 fUnpackFlipYSupport = ctxInfo.hasExtension("GL_CHROMIUM_flipy"); |
152 // no extension for pack row length | 152 // no extension for pack row length |
153 fPackRowLengthSupport = false; | 153 fPackRowLengthSupport = false; |
154 fPackFlipYSupport = | 154 fPackFlipYSupport = |
155 ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order"); | 155 ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order"); |
156 } | 156 } |
157 | 157 |
158 fTextureUsageSupport = (kES2_GrGLBinding == binding) && | 158 fTextureUsageSupport = (kES_GrGLBinding == binding) && |
159 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); | 159 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); |
160 | 160 |
161 // Tex storage is in desktop 4.2 and can be an extension to desktop or ES. | 161 // Tex storage is in desktop 4.2 and can be an extension to desktop or ES. |
162 fTexStorageSupport = (kDesktop_GrGLBinding == binding && | 162 fTexStorageSupport = (kDesktop_GrGLBinding == binding && |
163 version >= GR_GL_VER(4,2)) || | 163 version >= GR_GL_VER(4,2)) || |
164 ctxInfo.hasExtension("GL_ARB_texture_storage") || | 164 ctxInfo.hasExtension("GL_ARB_texture_storage") || |
165 ctxInfo.hasExtension("GL_EXT_texture_storage"); | 165 ctxInfo.hasExtension("GL_EXT_texture_storage"); |
166 | 166 |
167 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if | 167 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if |
168 // it doesn't have ARB_texture_rg extension. | 168 // it doesn't have ARB_texture_rg extension. |
169 if (kDesktop_GrGLBinding == binding) { | 169 if (kDesktop_GrGLBinding == binding) { |
170 if (ctxInfo.isMesa()) { | 170 if (ctxInfo.isMesa()) { |
171 fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); | 171 fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); |
172 } else { | 172 } else { |
173 fTextureRedSupport = version >= GR_GL_VER(3,0) || | 173 fTextureRedSupport = version >= GR_GL_VER(3,0) || |
174 ctxInfo.hasExtension("GL_ARB_texture_rg"); | 174 ctxInfo.hasExtension("GL_ARB_texture_rg"); |
175 } | 175 } |
176 } else { | 176 } else { |
177 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); | 177 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); |
178 } | 178 } |
179 | 179 |
180 fImagingSupport = kDesktop_GrGLBinding == binding && | 180 fImagingSupport = kDesktop_GrGLBinding == binding && |
181 ctxInfo.hasExtension("GL_ARB_imaging"); | 181 ctxInfo.hasExtension("GL_ARB_imaging"); |
182 | 182 |
183 // ES 2 only guarantees RGBA/uchar + one other format/type combo for | 183 // ES 2 only guarantees RGBA/uchar + one other format/type combo for |
184 // ReadPixels. The other format has to checked at run-time since it | 184 // ReadPixels. The other format has to checked at run-time since it |
185 // can change based on which render target is bound | 185 // can change based on which render target is bound |
186 fTwoFormatLimit = kES2_GrGLBinding == binding; | 186 fTwoFormatLimit = kES_GrGLBinding == binding; |
187 | 187 |
188 // Known issue on at least some Intel platforms: | 188 // Known issue on at least some Intel platforms: |
189 // http://code.google.com/p/skia/issues/detail?id=946 | 189 // http://code.google.com/p/skia/issues/detail?id=946 |
190 if (kIntel_GrGLVendor != ctxInfo.vendor()) { | 190 if (kIntel_GrGLVendor != ctxInfo.vendor()) { |
191 fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGe
neration || | 191 fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGe
neration || |
192 ctxInfo.hasExtension("GL_ARB_fragment_coo
rd_conventions"); | 192 ctxInfo.hasExtension("GL_ARB_fragment_coo
rd_conventions"); |
193 } | 193 } |
194 | 194 |
195 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with | 195 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with |
196 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex | 196 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex |
(...skipping 12 matching lines...) Expand all Loading... |
209 | 209 |
210 fDiscardFBSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuffer"); | 210 fDiscardFBSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuffer"); |
211 | 211 |
212 if (kDesktop_GrGLBinding == binding) { | 212 if (kDesktop_GrGLBinding == binding) { |
213 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 213 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
214 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); | 214 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); |
215 } else { | 215 } else { |
216 fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); | 216 fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); |
217 } | 217 } |
218 | 218 |
219 if (kES2_GrGLBinding == binding) { | 219 if (kES_GrGLBinding == binding) { |
220 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 220 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
221 fFBFetchType = kEXT_FBFetchType; | 221 fFBFetchType = kEXT_FBFetchType; |
222 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 222 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
223 fFBFetchType = kNV_FBFetchType; | 223 fFBFetchType = kNV_FBFetchType; |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 this->initFSAASupport(ctxInfo, gli); | 227 this->initFSAASupport(ctxInfo, gli); |
228 this->initStencilFormats(ctxInfo); | 228 this->initStencilFormats(ctxInfo); |
229 | 229 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 590 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
591 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 591 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
592 GrPrintf("Fragment coord conventions support: %s\n", | 592 GrPrintf("Fragment coord conventions support: %s\n", |
593 (fFragCoordsConventionSupport ? "YES": "NO")); | 593 (fFragCoordsConventionSupport ? "YES": "NO")); |
594 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 594 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
595 GrPrintf("Use non-VBO for dynamic data: %s\n", | 595 GrPrintf("Use non-VBO for dynamic data: %s\n", |
596 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 596 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
597 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 597 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
598 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); | 598 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); |
599 } | 599 } |
OLD | NEW |