Prevent caching path-rendering programs
As described in the comments, this is a workaround for a rare situation
when trying to use cached program binaries in conjunction with ANGLE and
path rendering.
Change-Id: Ief5bb0042f5ec13cbea2242ff9c4f0b9f9e65641
Bug: angle:3619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224258
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 0b56289..c7e8811 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -369,7 +369,12 @@
this->resolveProgramResourceLocations(programID, usedProgramBinaries);
this->cleanupShaders(shadersToDelete);
- if (!cached) {
+
+ // With ANGLE, we can't cache path-rendering programs. We use ProgramPathFragmentInputGen,
+ // and ANGLE's deserialized program state doesn't restore enough state to handle that.
+ // The native NVIDIA drivers do, but this is such an edge case that it's easier to just
+ // black-list caching these programs in all cases. See: anglebug.com/3619
+ if (!cached && !primProc.isPathRendering()) {
bool isSkSL = false;
#if GR_TEST_UTILS
if (fGpu->getContext()->priv().options().fCacheSKSL) {