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