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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 } | 710 } |
711 | 711 |
712 if (glslCaps->fExternalTextureSupport) { | 712 if (glslCaps->fExternalTextureSupport) { |
713 if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { | 713 if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { |
714 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern
al"; | 714 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern
al"; |
715 } else { | 715 } else { |
716 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern
al_essl3"; | 716 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern
al_essl3"; |
717 } | 717 } |
718 } | 718 } |
719 | 719 |
| 720 if (kGL_GrGLStandard == standard) { |
| 721 glslCaps->fBufferTextureSupport = ctxInfo.version() > GR_GL_VER(3, 1) && |
| 722 ctxInfo.glslGeneration() >= k330_GrGLS
LGeneration; |
| 723 } else { |
| 724 if (ctxInfo.version() > GR_GL_VER(3, 2) && |
| 725 ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) { |
| 726 glslCaps->fBufferTextureSupport = true; |
| 727 } else if (ctxInfo.hasExtension("GL_OES_texture_buffer")) { |
| 728 glslCaps->fBufferTextureSupport = true; |
| 729 glslCaps->fBufferTextureExtensionString = "GL_OES_texture_buffer"; |
| 730 } else if (ctxInfo.hasExtension("GL_EXT_texture_buffer")) { |
| 731 glslCaps->fBufferTextureSupport = true; |
| 732 glslCaps->fBufferTextureExtensionString = "GL_EXT_texture_buffer"; |
| 733 } |
| 734 } |
| 735 |
720 // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1.
0), so we must do | 736 // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1.
0), so we must do |
721 // the abs first in a separate expression. | 737 // the abs first in a separate expression. |
722 if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { | 738 if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { |
723 glslCaps->fCanUseMinAndAbsTogether = false; | 739 glslCaps->fCanUseMinAndAbsTogether = false; |
724 } | 740 } |
725 | 741 |
726 // On Intel GPU there is an issue where it reads the second argument to atan
"- %s.x" as an int | 742 // On Intel GPU there is an issue where it reads the second argument to atan
"- %s.x" as an int |
727 // thus must us -1.0 * %s.x to work correctly | 743 // thus must us -1.0 * %s.x to work correctly |
728 if (kIntel_GrGLVendor == ctxInfo.vendor()) { | 744 if (kIntel_GrGLVendor == ctxInfo.vendor()) { |
729 glslCaps->fMustForceNegatedAtanParamToFloat = true; | 745 glslCaps->fMustForceNegatedAtanParamToFloat = true; |
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1827 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1812 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1828 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1813 fConfigTable[i].fFormats.fExternalFormat[j]); | 1829 fConfigTable[i].fFormats.fExternalFormat[j]); |
1814 } | 1830 } |
1815 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1831 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1816 } | 1832 } |
1817 #endif | 1833 #endif |
1818 } | 1834 } |
1819 | 1835 |
1820 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1836 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |