Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1869063005: Add GLSL support for texelFetch (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_renaem
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLAssembleInterface.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 729
730 if (glslCaps->fExternalTextureSupport) { 730 if (glslCaps->fExternalTextureSupport) {
731 if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { 731 if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) {
732 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern al"; 732 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern al";
733 } else { 733 } else {
734 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern al_essl3"; 734 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern al_essl3";
735 } 735 }
736 } 736 }
737 737
738 if (kGL_GrGLStandard == standard) { 738 if (kGL_GrGLStandard == standard) {
739 glslCaps->fBufferTextureSupport = ctxInfo.version() > GR_GL_VER(3, 1) && 739 glslCaps->fTexelFetchSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGe neration;
740 ctxInfo.glslGeneration() >= k330_GrGLS LGeneration;
741 } else { 740 } else {
742 if (ctxInfo.version() > GR_GL_VER(3, 2) && 741 glslCaps->fTexelFetchSupport =
743 ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) { 742 ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // We use this va lue for GLSL ES 3.0.
744 glslCaps->fBufferTextureSupport = true; 743 }
745 } else if (ctxInfo.hasExtension("GL_OES_texture_buffer")) { 744
746 glslCaps->fBufferTextureSupport = true; 745 if (glslCaps->fTexelFetchSupport) {
747 glslCaps->fBufferTextureExtensionString = "GL_OES_texture_buffer"; 746 if (kGL_GrGLStandard == standard) {
748 } else if (ctxInfo.hasExtension("GL_EXT_texture_buffer")) { 747 glslCaps->fTexelBufferSupport = ctxInfo.version() >= GR_GL_VER(4, 3) &&
749 glslCaps->fBufferTextureSupport = true; 748 ctxInfo.glslGeneration() >= k330_GrG LSLGeneration;
750 glslCaps->fBufferTextureExtensionString = "GL_EXT_texture_buffer"; 749 } else {
750 if (ctxInfo.version() >= GR_GL_VER(3, 2) &&
751 ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
752 glslCaps->fTexelBufferSupport = true;
753 } else if (ctxInfo.hasExtension("GL_OES_texture_buffer")) {
754 glslCaps->fTexelBufferSupport = true;
755 glslCaps->fTexelBufferExtensionString = "GL_OES_texture_buffer";
756 } else if (ctxInfo.hasExtension("GL_EXT_texture_buffer")) {
757 glslCaps->fTexelBufferSupport = true;
758 glslCaps->fTexelBufferExtensionString = "GL_EXT_texture_buffer";
759 }
751 } 760 }
752 } 761 }
753 762
754 // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1. 0), so we must do 763 // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1. 0), so we must do
755 // the abs first in a separate expression. 764 // the abs first in a separate expression.
756 if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { 765 if (kTegra3_GrGLRenderer == ctxInfo.renderer()) {
757 glslCaps->fCanUseMinAndAbsTogether = false; 766 glslCaps->fCanUseMinAndAbsTogether = false;
758 } 767 }
759 768
760 // On Intel GPU there is an issue where it reads the second argument to atan "- %s.x" as an int 769 // On Intel GPU there is an issue where it reads the second argument to atan "- %s.x" as an int
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1884 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1876 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1885 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1877 fConfigTable[i].fFormats.fExternalFormat[j]); 1886 fConfigTable[i].fFormats.fExternalFormat[j]);
1878 } 1887 }
1879 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1888 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1880 } 1889 }
1881 #endif 1890 #endif
1882 } 1891 }
1883 1892
1884 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1893 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLAssembleInterface.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698