Add option to force GLSL string caching rather than program binaries.

Bug: chromium:924572
Change-Id: I055a6946528c75fa986c86fa562a2608b8958611
Reviewed-on: https://skia-review.googlesource.com/c/192827
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Brian Salomon 2019-02-15 10:05:06 -05:00 committed by Skia Commit-Bot
parent 7af8fe55bd
commit 28bafb01c9
2 changed files with 11 additions and 0 deletions

View File

@ -183,6 +183,14 @@ struct SK_API GrContextOptions {
*/
PersistentCache* fPersistentCache = nullptr;
/**
* This affects the usage of the PersistentCache. If this is set to true GLSL shader strings
* rather than GL program binaries will be cached. It is intended to be used when the driver's
* binary loading/storing is believed to have bugs. Caching GLSL strings still saves a
* significant amount of CPU work when a GL program is created.
*/
bool fDisallowGLSLBinaryCaching = false;
#if GR_TEST_UTILS
/**
* Private options that are only meant for testing within Skia's tools.

View File

@ -2818,6 +2818,9 @@ void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {
if (options.fDoManualMipmapping) {
fDoManualMipmapping = true;
}
if (options.fDisallowGLSLBinaryCaching) {
fProgramBinarySupport = false;
}
}
bool GrGLCaps::onSurfaceSupportsWritePixels(const GrSurface* surface) const {