diff options
author | 2018-05-08 13:00:42 -0400 | |
---|---|---|
committer | 2018-05-09 17:58:15 +0000 | |
commit | 06d374694a515d064a26e6c5391bce9a0c5c8aa0 (patch) | |
tree | ed01ed9d2d6c26ac10f350830d962ed2b6e70bc7 /src/gpu/gl | |
parent | cb8b5d1101d0a1bf7c78f3d1fec73afbe470994c (diff) |
Add fPreferExternalImagesOverES3 to GrContextOptions
This forces us to use the ES2 shading language when we have an ES3
context, but the driver claims to only support GL_OES_EGL_image_external
(and not the _essl3 variant). Many of these devices will work correctly
if we blindly enable both extensions, but there are some that won't.
Bug: skia:
Change-Id: Id632003a1905ea61b46166befd30905a57cead69
Reviewed-on: https://skia-review.googlesource.com/126681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLContext.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp index ffbae86bc9..a2a5a3b130 100644 --- a/src/gpu/gl/GrGLContext.cpp +++ b/src/gpu/gl/GrGLContext.cpp @@ -53,6 +53,21 @@ std::unique_ptr<GrGLContext> GrGLContext::Make(sk_sp<const GrGLInterface> interf args.fGLSLGeneration = k110_GrGLSLGeneration; } + // Many ES3 drivers only advertise the ES2 image_external extension, but support the _essl3 + // extension, and require that it be enabled to work with ESSL3. Other devices require the ES2 + // extension to be enabled, even when using ESSL3. Some devices appear to only support the ES2 + // extension. As an extreme (optional) solution, we can fallback to using ES2 shading language + // if we want to prioritize external texture support. skbug.com/7713 + if (kGLES_GrGLStandard == interface->fStandard && + options.fPreferExternalImagesOverES3 && + !options.fDisableDriverCorrectnessWorkarounds && + interface->hasExtension("GL_OES_EGL_image_external") && + args.fGLSLGeneration >= k330_GrGLSLGeneration && + !interface->hasExtension("GL_OES_EGL_image_external_essl3") && + !interface->hasExtension("OES_EGL_image_external_essl3")) { + args.fGLSLGeneration = k110_GrGLSLGeneration; + } + GrGLGetDriverInfo(interface->fStandard, args.fVendor, renderer, ver, &args.fDriver, &args.fDriverVersion); |