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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLAssembleInterface.cpp ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index fc2c8ce39857f600298167dc7116e6d9f68c6a8e..0322a0f57cdf23812eecf9d0b162b28c96ba38f8 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -736,18 +736,27 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) {
}
if (kGL_GrGLStandard == standard) {
- glslCaps->fBufferTextureSupport = ctxInfo.version() > GR_GL_VER(3, 1) &&
- ctxInfo.glslGeneration() >= k330_GrGLSLGeneration;
+ glslCaps->fTexelFetchSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
} else {
- if (ctxInfo.version() > GR_GL_VER(3, 2) &&
- ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
- glslCaps->fBufferTextureSupport = true;
- } else if (ctxInfo.hasExtension("GL_OES_texture_buffer")) {
- glslCaps->fBufferTextureSupport = true;
- glslCaps->fBufferTextureExtensionString = "GL_OES_texture_buffer";
- } else if (ctxInfo.hasExtension("GL_EXT_texture_buffer")) {
- glslCaps->fBufferTextureSupport = true;
- glslCaps->fBufferTextureExtensionString = "GL_EXT_texture_buffer";
+ glslCaps->fTexelFetchSupport =
+ ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // We use this value for GLSL ES 3.0.
+ }
+
+ if (glslCaps->fTexelFetchSupport) {
+ if (kGL_GrGLStandard == standard) {
+ glslCaps->fTexelBufferSupport = ctxInfo.version() >= GR_GL_VER(4, 3) &&
+ ctxInfo.glslGeneration() >= k330_GrGLSLGeneration;
+ } else {
+ if (ctxInfo.version() >= GR_GL_VER(3, 2) &&
+ ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
+ glslCaps->fTexelBufferSupport = true;
+ } else if (ctxInfo.hasExtension("GL_OES_texture_buffer")) {
+ glslCaps->fTexelBufferSupport = true;
+ glslCaps->fTexelBufferExtensionString = "GL_OES_texture_buffer";
+ } else if (ctxInfo.hasExtension("GL_EXT_texture_buffer")) {
+ glslCaps->fTexelBufferSupport = true;
+ glslCaps->fTexelBufferExtensionString = "GL_EXT_texture_buffer";
+ }
}
}
« 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