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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 if (kGLES_GrGLStandard == standard) { | 544 if (kGLES_GrGLStandard == standard) { |
545 return "#version 300 es\n"; | 545 return "#version 300 es\n"; |
546 } else { | 546 } else { |
547 SkASSERT(kGL_GrGLStandard == standard); | 547 SkASSERT(kGL_GrGLStandard == standard); |
548 if (isCoreProfile) { | 548 if (isCoreProfile) { |
549 return "#version 330\n"; | 549 return "#version 330\n"; |
550 } else { | 550 } else { |
551 return "#version 330 compatibility\n"; | 551 return "#version 330 compatibility\n"; |
552 } | 552 } |
553 } | 553 } |
| 554 case k400_GrGLSLGeneration: |
| 555 SkASSERT(kGL_GrGLStandard == standard); |
| 556 if (isCoreProfile) { |
| 557 return "#version 400\n"; |
| 558 } else { |
| 559 return "#version 400 compatibility\n"; |
| 560 } |
554 case k310es_GrGLSLGeneration: | 561 case k310es_GrGLSLGeneration: |
555 SkASSERT(kGLES_GrGLStandard == standard); | 562 SkASSERT(kGLES_GrGLStandard == standard); |
556 return "#version 310 es\n"; | 563 return "#version 310 es\n"; |
| 564 case k320es_GrGLSLGeneration: |
| 565 SkASSERT(kGLES_GrGLStandard == standard); |
| 566 return "#version 320 es\n"; |
557 } | 567 } |
558 return "<no version>"; | 568 return "<no version>"; |
559 } | 569 } |
560 | 570 |
561 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { | 571 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { |
562 GrGLStandard standard = ctxInfo.standard(); | 572 GrGLStandard standard = ctxInfo.standard(); |
563 GrGLVersion version = ctxInfo.version(); | 573 GrGLVersion version = ctxInfo.version(); |
564 | 574 |
565 /************************************************************************** | 575 /************************************************************************** |
566 * Caps specific to GrGLSLCaps | 576 * Caps specific to GrGLSLCaps |
(...skipping 21 matching lines...) Expand all Loading... |
588 glslCaps->fFBFetchSupport = true; | 598 glslCaps->fFBFetchSupport = true; |
589 glslCaps->fFBFetchColorName = "gl_LastFragColorARM"; | 599 glslCaps->fFBFetchColorName = "gl_LastFragColorARM"; |
590 glslCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch
"; | 600 glslCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch
"; |
591 } | 601 } |
592 glslCaps->fUsesPrecisionModifiers = true; | 602 glslCaps->fUsesPrecisionModifiers = true; |
593 } | 603 } |
594 | 604 |
595 glslCaps->fBindlessTextureSupport = ctxInfo.hasExtension("GL_NV_bindless_tex
ture"); | 605 glslCaps->fBindlessTextureSupport = ctxInfo.hasExtension("GL_NV_bindless_tex
ture"); |
596 | 606 |
597 if (kGL_GrGLStandard == standard) { | 607 if (kGL_GrGLStandard == standard) { |
| 608 glslCaps->fSampleVariablesSupport = ctxInfo.glslGeneration() >= k400_GrG
LSLGeneration; |
| 609 } else { |
| 610 if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) { |
| 611 glslCaps->fSampleVariablesSupport = true; |
| 612 } else if (ctxInfo.hasExtension("GL_OES_sample_variables")) { |
| 613 glslCaps->fSampleVariablesSupport = true; |
| 614 glslCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables
"; |
| 615 } |
| 616 } |
| 617 |
| 618 if (glslCaps->fSampleVariablesSupport) { |
| 619 glslCaps->fSampleMaskOverrideCoverageSupport = |
| 620 ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage"); |
| 621 } |
| 622 |
| 623 if (kGL_GrGLStandard == standard) { |
598 glslCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_G
rGLSLGeneration; | 624 glslCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_G
rGLSLGeneration; |
599 } else { | 625 } else { |
600 glslCaps->fFlatInterpolationSupport = | 626 glslCaps->fFlatInterpolationSupport = |
601 ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // This is the va
lue for GLSL ES 3.0. | 627 ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // This is the va
lue for GLSL ES 3.0. |
602 } | 628 } |
603 | 629 |
604 if (kGL_GrGLStandard == standard) { | 630 if (kGL_GrGLStandard == standard) { |
605 glslCaps->fNoPerspectiveInterpolationSupport = | 631 glslCaps->fNoPerspectiveInterpolationSupport = |
606 ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; | 632 ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; |
607 } else { | 633 } else { |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1708 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1683 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1709 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1684 fConfigTable[i].fFormats.fExternalFormat[j]); | 1710 fConfigTable[i].fFormats.fExternalFormat[j]); |
1685 } | 1711 } |
1686 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1712 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1687 } | 1713 } |
1688 #endif | 1714 #endif |
1689 } | 1715 } |
1690 | 1716 |
1691 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1717 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |