| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 if (kGLES_GrGLStandard == standard) { | 557 if (kGLES_GrGLStandard == standard) { |
| 558 return "#version 300 es\n"; | 558 return "#version 300 es\n"; |
| 559 } else { | 559 } else { |
| 560 SkASSERT(kGL_GrGLStandard == standard); | 560 SkASSERT(kGL_GrGLStandard == standard); |
| 561 if (isCoreProfile) { | 561 if (isCoreProfile) { |
| 562 return "#version 330\n"; | 562 return "#version 330\n"; |
| 563 } else { | 563 } else { |
| 564 return "#version 330 compatibility\n"; | 564 return "#version 330 compatibility\n"; |
| 565 } | 565 } |
| 566 } | 566 } |
| 567 case k400_GrGLSLGeneration: |
| 568 SkASSERT(kGL_GrGLStandard == standard); |
| 569 if (isCoreProfile) { |
| 570 return "#version 400\n"; |
| 571 } else { |
| 572 return "#version 400 compatibility\n"; |
| 573 } |
| 567 case k310es_GrGLSLGeneration: | 574 case k310es_GrGLSLGeneration: |
| 568 SkASSERT(kGLES_GrGLStandard == standard); | 575 SkASSERT(kGLES_GrGLStandard == standard); |
| 569 return "#version 310 es\n"; | 576 return "#version 310 es\n"; |
| 577 case k320es_GrGLSLGeneration: |
| 578 SkASSERT(kGLES_GrGLStandard == standard); |
| 579 return "#version 320 es\n"; |
| 570 } | 580 } |
| 571 return "<no version>"; | 581 return "<no version>"; |
| 572 } | 582 } |
| 573 | 583 |
| 574 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { | 584 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { |
| 575 GrGLStandard standard = ctxInfo.standard(); | 585 GrGLStandard standard = ctxInfo.standard(); |
| 576 GrGLVersion version = ctxInfo.version(); | 586 GrGLVersion version = ctxInfo.version(); |
| 577 | 587 |
| 578 /************************************************************************** | 588 /************************************************************************** |
| 579 * Caps specific to GrGLSLCaps | 589 * Caps specific to GrGLSLCaps |
| (...skipping 21 matching lines...) Expand all Loading... |
| 601 glslCaps->fFBFetchSupport = true; | 611 glslCaps->fFBFetchSupport = true; |
| 602 glslCaps->fFBFetchColorName = "gl_LastFragColorARM"; | 612 glslCaps->fFBFetchColorName = "gl_LastFragColorARM"; |
| 603 glslCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch
"; | 613 glslCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch
"; |
| 604 } | 614 } |
| 605 glslCaps->fUsesPrecisionModifiers = true; | 615 glslCaps->fUsesPrecisionModifiers = true; |
| 606 } | 616 } |
| 607 | 617 |
| 608 glslCaps->fBindlessTextureSupport = ctxInfo.hasExtension("GL_NV_bindless_tex
ture"); | 618 glslCaps->fBindlessTextureSupport = ctxInfo.hasExtension("GL_NV_bindless_tex
ture"); |
| 609 | 619 |
| 610 if (kGL_GrGLStandard == standard) { | 620 if (kGL_GrGLStandard == standard) { |
| 621 glslCaps->fSampleVariablesSupport = ctxInfo.glslGeneration() >= k400_GrG
LSLGeneration; |
| 622 } else { |
| 623 if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) { |
| 624 glslCaps->fSampleVariablesSupport = true; |
| 625 } else if (ctxInfo.hasExtension("GL_OES_sample_variables")) { |
| 626 glslCaps->fSampleVariablesSupport = true; |
| 627 glslCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables
"; |
| 628 } |
| 629 } |
| 630 |
| 631 if (glslCaps->fSampleVariablesSupport) { |
| 632 glslCaps->fSampleMaskOverrideCoverageSupport = |
| 633 ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage"); |
| 634 } |
| 635 |
| 636 if (kGL_GrGLStandard == standard) { |
| 611 glslCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_G
rGLSLGeneration; | 637 glslCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_G
rGLSLGeneration; |
| 612 } else { | 638 } else { |
| 613 glslCaps->fFlatInterpolationSupport = | 639 glslCaps->fFlatInterpolationSupport = |
| 614 ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // This is the va
lue for GLSL ES 3.0. | 640 ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // This is the va
lue for GLSL ES 3.0. |
| 615 } | 641 } |
| 616 | 642 |
| 617 if (kGL_GrGLStandard == standard) { | 643 if (kGL_GrGLStandard == standard) { |
| 618 glslCaps->fNoPerspectiveInterpolationSupport = | 644 glslCaps->fNoPerspectiveInterpolationSupport = |
| 619 ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; | 645 ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; |
| 620 } else { | 646 } else { |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1734 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1709 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1735 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1710 fConfigTable[i].fFormats.fExternalFormat[j]); | 1736 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1711 } | 1737 } |
| 1712 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1738 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1713 } | 1739 } |
| 1714 #endif | 1740 #endif |
| 1715 } | 1741 } |
| 1716 | 1742 |
| 1717 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1743 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |