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

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1688233003: Add arb_texture_rectangle support properly in GLES3 shaders Base URL: https://skia.googlesource.com/skia.git@command-buffer-es3
Patch Set: Created 4 years, 10 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 | « no previous file | src/gpu/gl/GrGLGpu.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 c2ace6cd368948d25d60f95b766895dcfd1ce740..d94f4876214f5457bde7547ef1a3d2e314a26b54 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -226,13 +226,19 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
}
}
- if ((kGL_GrGLStandard == standard && version >= GR_GL_VER(3, 1)) ||
- ctxInfo.hasExtension("GL_ARB_texture_rectangle")) {
- // We also require textureSize() support for rectangle 2D samplers which was added in GLSL
- // 1.40.
- if (ctxInfo.glslGeneration() >= k140_GrGLSLGeneration) {
- fRectangleTextureSupport = true;
+ if (kGL_GrGLStandard == standard) {
+ if (version >= GR_GL_VER(3, 1) || ctxInfo.hasExtension("GL_ARB_texture_rectangle")) {
+ // We also require textureSize() support for rectangle 2D samplers which was added in
+ // GLSL 1.40.
+ if (ctxInfo.glslGeneration() >= k140_GrGLSLGeneration) {
+ fRectangleTextureSupport = true;
+ }
}
+ } else {
+ // Command buffer exposes this in GL ES context for Chromium reasons,
+ // but it should not be used. Also, at the time of writing command buffer
+ // lacks TexImage2D support and ANGLE lacks GL ES 3.0 support.
+ fRectangleTextureSupport = ctxInfo.hasExtension("GL_ARB_texture_rectangle");
}
if (kGL_GrGLStandard == standard) {
@@ -632,6 +638,25 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) {
glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3";
}
}
+ if (fRectangleTextureSupport) {
+ if (kGL_GrGLStandard == standard) {
+ // "Conceptually, you can consider the declaration
+ // #extension GL_ARB_texture_rectangle : require, to allow support
+ // for texture rectangles, to be implicitly prepended to every
+ // GLSL shader when ARB_texture_rectangle is advertised."
+ // --> glslCaps->fRectangleTextureExtensionString == nullptr.
+ glslCaps->fRectangleTextureUseUnifiedTextureFunctionName =
+ ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
+ } else {
+ //"All future GLSL extensions should follow the "OpenGL Shading Language
+ // Extension Conventions" however."
+ // We imagine ANGLE implementation allowing ARB_texture_rectangle being
+ // based on an extension text requires the extension string.
+ glslCaps->fRectangleTextureExtensionString = "GL_ARB_texture_rectangle";
+ glslCaps->fRectangleTextureUseUnifiedTextureFunctionName =
+ ctxInfo.glslGeneration() == k330_GrGLSLGeneration;
+ }
+ }
// The Tegra3 compiler will sometimes never return if we have min(abs(x), 1.0), so we must do
// the abs first in a separate expression.
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698