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 25 matching lines...) Expand all Loading... |
36 fTexStorageSupport = false; | 36 fTexStorageSupport = false; |
37 fTextureRedSupport = false; | 37 fTextureRedSupport = false; |
38 fImagingSupport = false; | 38 fImagingSupport = false; |
39 fTwoFormatLimit = false; | 39 fTwoFormatLimit = false; |
40 fFragCoordsConventionSupport = false; | 40 fFragCoordsConventionSupport = false; |
41 fVertexArrayObjectSupport = false; | 41 fVertexArrayObjectSupport = false; |
42 fInstancedDrawingSupport = false; | 42 fInstancedDrawingSupport = false; |
43 fDirectStateAccessSupport = false; | 43 fDirectStateAccessSupport = false; |
44 fDebugSupport = false; | 44 fDebugSupport = false; |
45 fES2CompatibilitySupport = false; | 45 fES2CompatibilitySupport = false; |
46 fMultisampleDisableSupport = false; | |
47 fUseNonVBOVertexAndIndexDynamicData = false; | 46 fUseNonVBOVertexAndIndexDynamicData = false; |
48 fIsCoreProfile = false; | 47 fIsCoreProfile = false; |
49 fBindFragDataLocationSupport = false; | 48 fBindFragDataLocationSupport = false; |
50 fSRGBWriteControl = false; | 49 fSRGBWriteControl = false; |
51 fRGBA8888PixelsOpsAreSlow = false; | 50 fRGBA8888PixelsOpsAreSlow = false; |
52 fPartialFBOReadIsSlow = false; | 51 fPartialFBOReadIsSlow = false; |
53 | 52 |
54 fReadPixelsSupportedCache.reset(); | 53 fReadPixelsSupportedCache.reset(); |
55 | 54 |
56 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); | 55 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 fES2CompatibilitySupport = true; | 245 fES2CompatibilitySupport = true; |
247 } | 246 } |
248 | 247 |
249 if (kGL_GrGLStandard == standard) { | 248 if (kGL_GrGLStandard == standard) { |
250 fMultisampleDisableSupport = true; | 249 fMultisampleDisableSupport = true; |
251 } else { | 250 } else { |
252 fMultisampleDisableSupport = ctxInfo.hasExtension("GL_EXT_multisample_co
mpatibility"); | 251 fMultisampleDisableSupport = ctxInfo.hasExtension("GL_EXT_multisample_co
mpatibility"); |
253 } | 252 } |
254 | 253 |
255 if (kGL_GrGLStandard == standard) { | 254 if (kGL_GrGLStandard == standard) { |
| 255 fProgrammableSampleLocationsSupport = |
| 256 ctxInfo.version() >= GR_GL_VER(4, 3) && |
| 257 (ctxInfo.hasExtension("GL_ARB_sample_locations") || |
| 258 ctxInfo.hasExtension("GL_NV_sample_locations")); |
| 259 } else { |
| 260 fProgrammableSampleLocationsSupport = |
| 261 ctxInfo.version() >= GR_GL_VER(3, 1) && |
| 262 ctxInfo.hasExtension("GL_NV_sample_locations"); |
| 263 } |
| 264 |
| 265 if (kGL_GrGLStandard == standard) { |
256 if (version >= GR_GL_VER(3, 0)) { | 266 if (version >= GR_GL_VER(3, 0)) { |
257 fBindFragDataLocationSupport = true; | 267 fBindFragDataLocationSupport = true; |
258 } | 268 } |
259 } else { | 269 } else { |
260 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun
c_extended")) { | 270 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun
c_extended")) { |
261 fBindFragDataLocationSupport = true; | 271 fBindFragDataLocationSupport = true; |
262 } | 272 } |
263 } | 273 } |
264 | 274 |
265 #if 0 // Disabled due to http://skbug.com/4454 | 275 #if 0 // Disabled due to http://skbug.com/4454 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& | 313 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& |
304 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; | 314 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; |
305 } | 315 } |
306 else { | 316 else { |
307 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); | 317 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); |
308 | 318 |
309 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || | 319 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || |
310 ctxInfo.hasExtension("GL_OES_standard_derivatives"); | 320 ctxInfo.hasExtension("GL_OES_standard_derivatives"); |
311 } | 321 } |
312 | 322 |
313 if (kGL_GrGLStandard == standard) { | |
314 glslCaps->fProgrammableSampleLocationsSupport = | |
315 ctxInfo.version() >= GR_GL_VER(4, 3) && | |
316 (ctxInfo.hasExtension("GL_ARB_sample_locations") || | |
317 ctxInfo.hasExtension("GL_NV_sample_locations")); | |
318 } else { | |
319 glslCaps->fProgrammableSampleLocationsSupport = | |
320 ctxInfo.version() >= GR_GL_VER(3, 1) && | |
321 ctxInfo.hasExtension("GL_NV_sample_locations"); | |
322 } | |
323 | |
324 /************************************************************************** | 323 /************************************************************************** |
325 * GrCaps fields | 324 * GrCaps fields |
326 **************************************************************************/ | 325 **************************************************************************/ |
327 | 326 |
328 // We need dual source blending and the ability to disable multisample in or
der to support mixed | 327 // We need dual source blending and the ability to disable multisample in or
der to support mixed |
329 // samples in every corner case. | 328 // samples in every corner case. |
330 if (fMultisampleDisableSupport && glslCaps->dualSourceBlendingSupport()) { | 329 if (fMultisampleDisableSupport && glslCaps->dualSourceBlendingSupport()) { |
331 fMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sam
ples"); | 330 fMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sam
ples"); |
332 // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed sa
mples. | 331 // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed sa
mples. |
333 if (fMixedSamplesSupport && kNVIDIA_GrGLDriver == ctxInfo.driver()) { | 332 if (fMixedSamplesSupport && kNVIDIA_GrGLDriver == ctxInfo.driver()) { |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO"
)); | 1175 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO"
)); |
1177 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 1176 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
1178 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 1177 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
1179 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1178 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
1180 r.appendf("Fragment coord conventions support: %s\n", | 1179 r.appendf("Fragment coord conventions support: %s\n", |
1181 (fFragCoordsConventionSupport ? "YES": "NO")); | 1180 (fFragCoordsConventionSupport ? "YES": "NO")); |
1182 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1181 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
1183 r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YE
S": "NO")); | 1182 r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YE
S": "NO")); |
1184 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ?
"YES": "NO")); | 1183 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ?
"YES": "NO")); |
1185 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); | 1184 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); |
1186 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ?
"YES" : "NO")); | |
1187 r.appendf("Use non-VBO for dynamic data: %s\n", | 1185 r.appendf("Use non-VBO for dynamic data: %s\n", |
1188 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1186 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
1189 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); | 1187 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); |
1190 r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow ?
"YES" : "NO")); | 1188 r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow ?
"YES" : "NO")); |
1191 r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow ? "YES" :
"NO")); | 1189 r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow ? "YES" :
"NO")); |
1192 r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSuppor
t ? "YES" : "NO")); | 1190 r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSuppor
t ? "YES" : "NO")); |
1193 return r; | 1191 return r; |
1194 } | 1192 } |
1195 | 1193 |
1196 static GrGLenum precision_to_gl_float_type(GrSLPrecision p) { | 1194 static GrGLenum precision_to_gl_float_type(GrSLPrecision p) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr"; | 1309 glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr"; |
1312 glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba"; | 1310 glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba"; |
1313 glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba"; | 1311 glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba"; |
1314 glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba"; | 1312 glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba"; |
1315 | 1313 |
1316 } | 1314 } |
1317 | 1315 |
1318 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1316 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
1319 | 1317 |
1320 | 1318 |
OLD | NEW |