ccpr: Fail gracefully when atlas instantiation fails

This fixes a crash, but still does not answer the question why
8192x8192 msaa atlas instantiations are failing sporadically on
vulkan. Luckily we will be switching to mixed samples soon, so this
problem is very temporary.

Change-Id: I7dedb3c943f432543c12f02587ece8d71443a1cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252646
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2019-11-04 16:47:39 -07:00
parent e9b546970e
commit 36574af816

View File

@ -446,15 +446,15 @@ void GrCCDrawPathsOp::onExecute(GrOpFlushState* flushState, const SkRect& chainB
SkASSERT(range.fEndInstanceIdx > baseInstance);
const GrTextureProxy* atlas = range.fAtlasProxy;
SkASSERT(atlas->isInstantiated());
GrCCPathProcessor pathProc(
range.fCoverageMode, atlas->peekTexture(), atlas->textureSwizzle(), atlas->origin(),
fViewMatrixIfUsingLocalCoords);
GrTextureProxy* atlasProxy = range.fAtlasProxy;
fixedDynamicState.fPrimitiveProcessorTextures = &atlasProxy;
pathProc.drawPaths(flushState, pipeline, &fixedDynamicState, *resources, baseInstance,
range.fEndInstanceIdx, this->bounds());
if (atlas->isInstantiated()) { // Instantiation can fail in exceptional circumstances.
GrCCPathProcessor pathProc(range.fCoverageMode, atlas->peekTexture(),
atlas->textureSwizzle(), atlas->origin(),
fViewMatrixIfUsingLocalCoords);
GrTextureProxy* atlasProxy = range.fAtlasProxy;
fixedDynamicState.fPrimitiveProcessorTextures = &atlasProxy;
pathProc.drawPaths(flushState, pipeline, &fixedDynamicState, *resources, baseInstance,
range.fEndInstanceIdx, this->bounds());
}
baseInstance = range.fEndInstanceIdx;
}