Store the correct number of samples in GrProgramInfo
Bug: skia:11396
Change-Id: I9480b89635bd7a6bdff8ab4876c8eeafdbc27c8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442096
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/ops/PathStencilCoverOp.cpp b/src/gpu/ops/PathStencilCoverOp.cpp
index dc56c74..15cd7f8 100644
--- a/src/gpu/ops/PathStencilCoverOp.cpp
+++ b/src/gpu/ops/PathStencilCoverOp.cpp
@@ -184,9 +184,11 @@
auto* bboxStencil = GrPathTessellationShader::TestAndResetStencilSettings(
SkPathFillType_IsInverse(this->pathFillType()));
fCoverBBoxProgram = GrSimpleMeshDrawOpHelper::CreateProgramInfo(
+ args.fCaps,
args.fArena,
bboxPipeline,
args.fWriteView,
+ args.fUsesMSAASurface,
bboxShader,
GrPrimitiveType::kTriangleStrip,
args.fXferBarrierFlags,
@@ -200,8 +202,11 @@
const GrDstProxyView& dstProxyView,
GrXferBarrierFlags renderPassXferBarriers,
GrLoadOp colorLoadOp) {
- this->prePreparePrograms({context->priv().recordTimeAllocator(), writeView, &dstProxyView,
- renderPassXferBarriers, colorLoadOp, context->priv().caps()},
+ // DMSAA is not supported on DDL.
+ bool usesMSAASurface = writeView.asRenderTargetProxy()->numSamples() > 1;
+ this->prePreparePrograms({context->priv().recordTimeAllocator(), writeView, usesMSAASurface,
+ &dstProxyView, renderPassXferBarriers, colorLoadOp,
+ context->priv().caps()},
(clip) ? std::move(*clip) : GrAppliedClip::Disabled());
if (fStencilFanProgram) {
context->priv().recordProgramInfo(fStencilFanProgram);
@@ -219,9 +224,9 @@
void PathStencilCoverOp::onPrepare(GrOpFlushState* flushState) {
if (!fTessellator) {
this->prePreparePrograms({flushState->allocator(), flushState->writeView(),
- &flushState->dstProxyView(), flushState->renderPassBarriers(),
- flushState->colorLoadOp(), &flushState->caps()},
- flushState->detachAppliedClip());
+ flushState->usesMSAASurface(), &flushState->dstProxyView(),
+ flushState->renderPassBarriers(), flushState->colorLoadOp(),
+ &flushState->caps()}, flushState->detachAppliedClip());
if (!fTessellator) {
return;
}