[graphite] Clear depth/stencil attachments to 0

Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12700, skia:12703
Change-Id: I0d32b2542bf779c2e2229ad3f56eca2129ff3b8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483521
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Michael Ludwig 2021-12-13 11:53:14 -05:00 committed by SkCQ
parent 3ad6e531c3
commit fdae1b765f

View File

@ -131,8 +131,11 @@ sk_sp<Task> DrawContext::snapRenderPassTask(Recorder* recorder,
caps->getDefaultDepthStencilTextureInfo(drawPass->depthStencilFlags(),
1 /*sampleCount*/, // TODO: MSAA
Protected::kNo);
// TODO: handle clears
desc.fDepthStencilAttachment.fLoadOp = LoadOp::kDiscard;
// Always clear the depth and stencil to 0 at the start of a DrawPass, but discard at the
// end since their contents do not affect the next frame.
desc.fDepthStencilAttachment.fLoadOp = LoadOp::kClear;
desc.fClearDepth = 0.f;
desc.fClearStencil = 0;
desc.fDepthStencilAttachment.fStoreOp = StoreOp::kDiscard;
}