aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-03-15 14:12:04 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-16 13:08:32 +0000
commit91fba61f24943a6e12f69732d9308beb76f8a7c6 (patch)
tree678bc8d485371497a170d538b3efba19b3e85854 /src/gpu/gl/GrGLCaps.cpp
parent6e9a4f6327d1c9b1cac26d4d091b9f4fbb0cf4fc (diff)
Support GL_OES_EGL_image_external on newer GLSL without essl3
Bug: skia:7713 Change-Id: I15c6a55370848cd211c783c886923f31dec1788c Reviewed-on: https://skia-review.googlesource.com/114505 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 5134314fef..0a5c2fe7b7 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -759,20 +759,17 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli
}
if (ctxInfo.hasExtension("GL_OES_EGL_image_external")) {
- if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) {
- shaderCaps->fExternalTextureSupport = true;
- } else if (ctxInfo.hasExtension("GL_OES_EGL_image_external_essl3") ||
- ctxInfo.hasExtension("OES_EGL_image_external_essl3")) {
+ // We should check that we're using ES2 shading language, or have the ESSL3 extension,
+ // but we found at least one device that breaks that rule. So, we enable support via the
+ // ES2 extension if the ES2 extension is missing. This could fail if a device only supports
+ // external images in ES2, but that seems unlikely? (skbug.com/7713)
+ shaderCaps->fExternalTextureSupport = true;
+ if (ctxInfo.hasExtension("GL_OES_EGL_image_external_essl3") ||
+ ctxInfo.hasExtension("OES_EGL_image_external_essl3")) {
// At least one driver has been found that has this extension without the "GL_" prefix.
- shaderCaps->fExternalTextureSupport = true;
- }
- }
-
- if (shaderCaps->fExternalTextureSupport) {
- if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) {
- shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external";
- } else {
shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3";
+ } else {
+ shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external";
}
}