| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); | 107 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); |
| 108 | 108 |
| 109 if (kGL_GrGLStandard == standard) { | 109 if (kGL_GrGLStandard == standard) { |
| 110 // The EXT version can apply to either GL or GLES. | 110 // The EXT version can apply to either GL or GLES. |
| 111 fTexStorageSupport = version >= GR_GL_VER(4,2) || | 111 fTexStorageSupport = version >= GR_GL_VER(4,2) || |
| 112 ctxInfo.hasExtension("GL_ARB_texture_storage") || | 112 ctxInfo.hasExtension("GL_ARB_texture_storage") || |
| 113 ctxInfo.hasExtension("GL_EXT_texture_storage"); | 113 ctxInfo.hasExtension("GL_EXT_texture_storage"); |
| 114 } else { | 114 } else { |
| 115 // Qualcomm Adreno drivers appear to have issues with texture storage. | 115 // Qualcomm Adreno drivers appear to have issues with texture storage. |
| 116 fTexStorageSupport = (version >= GR_GL_VER(3,0) && | 116 fTexStorageSupport = (version >= GR_GL_VER(3,0) && |
| 117 kQualcomm_GrGLVendor != ctxInfo.vendor()) || | 117 kQualcomm_GrGLVendor != ctxInfo.vendor()) && |
| 118 ctxInfo.hasExtension("GL_EXT_texture_storage"); | 118 ctxInfo.hasExtension("GL_EXT_texture_storage"); |
| 119 } | 119 } |
| 120 | 120 |
| 121 if (kGL_GrGLStandard == standard) { | 121 if (kGL_GrGLStandard == standard) { |
| 122 fTextureBarrierSupport = version >= GR_GL_VER(4,5) || | 122 fTextureBarrierSupport = version >= GR_GL_VER(4,5) || |
| 123 ctxInfo.hasExtension("GL_ARB_texture_barrier")
|| | 123 ctxInfo.hasExtension("GL_ARB_texture_barrier")
|| |
| 124 ctxInfo.hasExtension("GL_NV_texture_barrier"); | 124 ctxInfo.hasExtension("GL_NV_texture_barrier"); |
| 125 } else { | 125 } else { |
| 126 fTextureBarrierSupport = ctxInfo.hasExtension("GL_NV_texture_barrier"); | 126 fTextureBarrierSupport = ctxInfo.hasExtension("GL_NV_texture_barrier"); |
| 127 } | 127 } |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // extension includes glMapBuffer. | 348 // extension includes glMapBuffer. |
| 349 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_map_buffe
r_range")) { | 349 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_map_buffe
r_range")) { |
| 350 fMapBufferFlags |= kSubset_MapFlag; | 350 fMapBufferFlags |= kSubset_MapFlag; |
| 351 fMapBufferType = kMapBufferRange_MapBufferType; | 351 fMapBufferType = kMapBufferRange_MapBufferType; |
| 352 } else { | 352 } else { |
| 353 fMapBufferType = kMapBuffer_MapBufferType; | 353 fMapBufferType = kMapBuffer_MapBufferType; |
| 354 } | 354 } |
| 355 } else { | 355 } else { |
| 356 // Unextended GLES2 doesn't have any buffer mapping. | 356 // Unextended GLES2 doesn't have any buffer mapping. |
| 357 fMapBufferFlags = kNone_MapBufferType; | 357 fMapBufferFlags = kNone_MapBufferType; |
| 358 if (ctxInfo.hasExtension("GL_CHROMIUM_map_sub")) { | 358 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_map_buffe
r_range")) { |
| 359 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; |
| 360 fMapBufferType = kMapBufferRange_MapBufferType; |
| 361 } else if (ctxInfo.hasExtension("GL_CHROMIUM_map_sub")) { |
| 359 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; | 362 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; |
| 360 fMapBufferType = kChromium_MapBufferType; | 363 fMapBufferType = kChromium_MapBufferType; |
| 361 } else if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_ma
p_buffer_range")) { | |
| 362 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; | |
| 363 fMapBufferType = kMapBufferRange_MapBufferType; | |
| 364 } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) { | 364 } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) { |
| 365 fMapBufferFlags = kCanMap_MapFlag; | 365 fMapBufferFlags = kCanMap_MapFlag; |
| 366 fMapBufferType = kMapBuffer_MapBufferType; | 366 fMapBufferType = kMapBuffer_MapBufferType; |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 if (kGL_GrGLStandard == standard) { | 370 if (kGL_GrGLStandard == standard) { |
| 371 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_pixel_buf
fer_object")) { | 371 if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_pixel_buf
fer_object")) { |
| 372 fTransferBufferType = kPBO_TransferBufferType; | 372 fTransferBufferType = kPBO_TransferBufferType; |
| 373 } | 373 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indi
rect"); | 502 fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indi
rect"); |
| 503 fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance"); | 503 fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance"); |
| 504 } | 504 } |
| 505 | 505 |
| 506 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); | 506 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); |
| 507 | 507 |
| 508 if (contextOptions.fUseShaderSwizzling) { | 508 if (contextOptions.fUseShaderSwizzling) { |
| 509 fTextureSwizzleSupport = false; | 509 fTextureSwizzleSupport = false; |
| 510 } | 510 } |
| 511 | 511 |
| 512 // TODO: remove after command buffer supports full ES 3.0. |
| 513 if (kGLES_GrGLStandard == standard && version >= GR_GL_VER(3, 0) && |
| 514 kChromium_GrGLDriver == ctxInfo.driver()) { |
| 515 fTexStorageSupport = false; |
| 516 fSupportsInstancedDraws = false; |
| 517 fTextureSwizzleSupport = false; |
| 518 SkASSERT(ctxInfo.hasExtension("GL_CHROMIUM_map_sub")); |
| 519 fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; |
| 520 fMapBufferType = kChromium_MapBufferType; |
| 521 } |
| 522 |
| 512 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have | 523 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have |
| 513 // already been detected. | 524 // already been detected. |
| 514 this->initConfigTable(ctxInfo, gli, glslCaps); | 525 this->initConfigTable(ctxInfo, gli, glslCaps); |
| 515 | 526 |
| 516 this->applyOptionsOverrides(contextOptions); | 527 this->applyOptionsOverrides(contextOptions); |
| 517 glslCaps->applyOptionsOverrides(contextOptions); | 528 glslCaps->applyOptionsOverrides(contextOptions); |
| 518 } | 529 } |
| 519 | 530 |
| 520 const char* get_glsl_version_decl_string(GrGLStandard standard, GrGLSLGeneration
generation, | 531 const char* get_glsl_version_decl_string(GrGLStandard standard, GrGLSLGeneration
generation, |
| 521 bool isCoreProfile) { | 532 bool isCoreProfile) { |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1708 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1698 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1709 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1699 fConfigTable[i].fFormats.fExternalFormat[j]); | 1710 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1700 } | 1711 } |
| 1701 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1712 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1702 } | 1713 } |
| 1703 #endif | 1714 #endif |
| 1704 } | 1715 } |
| 1705 | 1716 |
| 1706 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1717 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |