diff options
author | Brian Osman <brianosman@google.com> | 2018-04-04 14:08:27 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-05 13:42:32 +0000 |
commit | c585e20f5a7a49808ddf6ac12af287f226bb26dc (patch) | |
tree | 940a31d110910ff75e0fe97b2af60c42b9534065 /src/gpu | |
parent | ba75aee95224af408219e05092208ba3c5099028 (diff) |
Workaround for lack of ESSL3 external image extension on older Samsung devices
This undoes the original workaround[1] and moves it to our caps
workarounds. It also forces us to use the ESSL3 extension string when
applying the workaround, as that appears to be necessary. (Otherwise,
offending devices just fail to compile when using the older extension
string with a newer GLSL version).
[1] https://skia-review.googlesource.com/c/skia/+/114505
Bug: skia:7713
Change-Id: I9757034b282a663c6e4d5fd19889c977a12a4d91
Reviewed-on: https://skia-review.googlesource.com/118665
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 1ec0a304ba..421ca25bbd 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -759,17 +759,14 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli } if (ctxInfo.hasExtension("GL_OES_EGL_image_external")) { - // 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")) { + if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { + shaderCaps->fExternalTextureSupport = true; + shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; + } else 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; shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; - } else { - shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; } } @@ -2471,6 +2468,17 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo, fDiscardRenderTargetSupport = false; fInvalidateFBType = kNone_InvalidateFBType; } + + // Various Samsung devices (Note4, S7, ...) don't advertise the image_external_essl3 extension, + // (only the base image_external extension), but do support it, and require that it be enabled + // to work with ESSL3. This has been seen on both Mali and Adreno devices. skbug.com/7713 + if (ctxInfo.hasExtension("GL_OES_EGL_image_external") && + ctxInfo.glslGeneration() >= k330_GrGLSLGeneration && + !shaderCaps->fExternalTextureSupport && // i.e. Missing the _essl3 extension + (kARM_GrGLVendor == ctxInfo.vendor() || kQualcomm_GrGLVendor == ctxInfo.vendor())) { + shaderCaps->fExternalTextureSupport = true; + shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; + } } void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) { |