Do not try to use GL_texture_rectangle on GL ES

Do not try to use ARB_GL_texture_rectangle on GL ES.
Command buffer exposes it, but it's not recommended. It also
does not work with TexImage2D, and ANGLE does not
have support for it on with GL ES 3.0 source context.

Bug triggered only when trying to use command buffer in
GL ES 3.0 mode.

BUG=angleproject:1313
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1691853003

Review URL: https://codereview.chromium.org/1691853003
This commit is contained in:
kkinnunen 2016-02-16 23:15:40 -08:00 committed by Commit bot
parent 32a45f6c96
commit e06ed25540

View File

@ -228,13 +228,18 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
} }
} }
if ((kGL_GrGLStandard == standard && version >= GR_GL_VER(3, 1)) || if (kGL_GrGLStandard == standard) {
ctxInfo.hasExtension("GL_ARB_texture_rectangle")) { 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 // We also require textureSize() support for rectangle 2D samplers which was added in
// 1.40. // GLSL 1.40.
if (ctxInfo.glslGeneration() >= k140_GrGLSLGeneration) { if (ctxInfo.glslGeneration() >= k140_GrGLSLGeneration) {
fRectangleTextureSupport = true; 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.
} }
if (kGL_GrGLStandard == standard) { if (kGL_GrGLStandard == standard) {