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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 } | 518 } |
519 | 519 |
520 if (kGL_GrGLStandard == standard) { | 520 if (kGL_GrGLStandard == standard) { |
521 fDrawIndirectSupport = version >= GR_GL_VER(4,0) || | 521 fDrawIndirectSupport = version >= GR_GL_VER(4,0) || |
522 ctxInfo.hasExtension("GL_ARB_draw_indirect"); | 522 ctxInfo.hasExtension("GL_ARB_draw_indirect"); |
523 fBaseInstanceSupport = version >= GR_GL_VER(4,2); | 523 fBaseInstanceSupport = version >= GR_GL_VER(4,2); |
524 fMultiDrawIndirectSupport = version >= GR_GL_VER(4,3) || | 524 fMultiDrawIndirectSupport = version >= GR_GL_VER(4,3) || |
525 (fDrawIndirectSupport && | 525 (fDrawIndirectSupport && |
526 !fBaseInstanceSupport && // The ARB extensi
on has no base inst. | 526 !fBaseInstanceSupport && // The ARB extensi
on has no base inst. |
527 ctxInfo.hasExtension("GL_ARB_multi_draw_ind
irect")); | 527 ctxInfo.hasExtension("GL_ARB_multi_draw_ind
irect")); |
| 528 fDrawRangeElementsSupport = version >= GR_GL_VER(2,0); |
528 } else { | 529 } else { |
529 fDrawIndirectSupport = version >= GR_GL_VER(3,1); | 530 fDrawIndirectSupport = version >= GR_GL_VER(3,1); |
530 fMultiDrawIndirectSupport = fDrawIndirectSupport && | 531 fMultiDrawIndirectSupport = fDrawIndirectSupport && |
531 ctxInfo.hasExtension("GL_EXT_multi_draw_indi
rect"); | 532 ctxInfo.hasExtension("GL_EXT_multi_draw_indi
rect"); |
532 fBaseInstanceSupport = fDrawIndirectSupport && | 533 fBaseInstanceSupport = fDrawIndirectSupport && |
533 ctxInfo.hasExtension("GL_EXT_base_instance"); | 534 ctxInfo.hasExtension("GL_EXT_base_instance"); |
| 535 fDrawRangeElementsSupport = version >= GR_GL_VER(3,0); |
534 } | 536 } |
535 | 537 |
536 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); | 538 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); |
537 | 539 |
538 if (contextOptions.fUseShaderSwizzling) { | 540 if (contextOptions.fUseShaderSwizzling) { |
539 fTextureSwizzleSupport = false; | 541 fTextureSwizzleSupport = false; |
540 } | 542 } |
541 | 543 |
542 if (kGL_GrGLStandard == standard) { | 544 if (kGL_GrGLStandard == standard) { |
543 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s
hading")) && | 545 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s
hading")) && |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) { | 1954 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) { |
1953 if (options.fEnableInstancedRendering) { | 1955 if (options.fEnableInstancedRendering) { |
1954 fInstancedSupport = gr_instanced::GLInstancedRendering::CheckSupport(*th
is); | 1956 fInstancedSupport = gr_instanced::GLInstancedRendering::CheckSupport(*th
is); |
1955 #ifndef SK_BUILD_FOR_MAC | 1957 #ifndef SK_BUILD_FOR_MAC |
1956 // OS X doesn't seem to write correctly to floating point textures when
using | 1958 // OS X doesn't seem to write correctly to floating point textures when
using |
1957 // glDraw*Indirect, regardless of the underlying GPU. | 1959 // glDraw*Indirect, regardless of the underlying GPU. |
1958 fAvoidInstancedDrawsToFPTargets = true; | 1960 fAvoidInstancedDrawsToFPTargets = true; |
1959 #endif | 1961 #endif |
1960 } | 1962 } |
1961 } | 1963 } |
OLD | NEW |