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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 (ctxInfo.hasExtension("GL_ARB_draw_instanced") && | 511 (ctxInfo.hasExtension("GL_ARB_draw_instanced") && |
512 ctxInfo.hasExtension("GL_ARB_instanced_arrays")); | 512 ctxInfo.hasExtension("GL_ARB_instanced_arrays")); |
513 } else { | 513 } else { |
514 fSupportsInstancedDraws = | 514 fSupportsInstancedDraws = |
515 version >= GR_GL_VER(3, 0) || | 515 version >= GR_GL_VER(3, 0) || |
516 (ctxInfo.hasExtension("GL_EXT_draw_instanced") && | 516 (ctxInfo.hasExtension("GL_EXT_draw_instanced") && |
517 ctxInfo.hasExtension("GL_EXT_instanced_arrays")); | 517 ctxInfo.hasExtension("GL_EXT_instanced_arrays")); |
518 } | 518 } |
519 | 519 |
520 if (kGL_GrGLStandard == standard) { | 520 if (kGL_GrGLStandard == standard) { |
521 // We don't use ARB_draw_indirect because it does not support a base ins
tance. | 521 fDrawIndirectSupport = version >= GR_GL_VER(4,0) || |
522 // We don't use ARB_multi_draw_indirect because it does not support GL_D
RAW_INDIRECT_BUFFER. | 522 ctxInfo.hasExtension("GL_ARB_draw_indirect"); |
523 fDrawIndirectSupport = | 523 fBaseInstanceSupport = version >= GR_GL_VER(4,2); |
524 fMultiDrawIndirectSupport = fBaseInstanceSupport = version >= GR_GL_
VER(4,3); | 524 fMultiDrawIndirectSupport = version >= GR_GL_VER(4,3) || |
| 525 (!fBaseInstanceSupport && // The ARB extensi
on has no base inst. |
| 526 ctxInfo.hasExtension("GL_ARB_multi_draw_ind
irect")); |
525 } else { | 527 } else { |
526 fDrawIndirectSupport = version >= GR_GL_VER(3,1); | 528 fDrawIndirectSupport = version >= GR_GL_VER(3,1); |
527 fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indi
rect"); | 529 fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indi
rect"); |
528 fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance"); | 530 fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance"); |
529 } | 531 } |
530 | 532 |
531 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); | 533 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); |
532 | 534 |
533 if (contextOptions.fUseShaderSwizzling) { | 535 if (contextOptions.fUseShaderSwizzling) { |
534 fTextureSwizzleSupport = false; | 536 fTextureSwizzleSupport = false; |
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1912 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1911 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1913 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1912 fConfigTable[i].fFormats.fExternalFormat[j]); | 1914 fConfigTable[i].fFormats.fExternalFormat[j]); |
1913 } | 1915 } |
1914 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1916 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1915 } | 1917 } |
1916 #endif | 1918 #endif |
1917 } | 1919 } |
1918 | 1920 |
1919 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1921 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |