From dbdba60274515c4df02cb667d2f8e2738418855f Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 20 Apr 2018 11:52:43 -0400 Subject: Add discard check when deciding if we should execute op list or not. Bug: skia:7828 Change-Id: I339ba64b6312cd9444cd4faffd426d91852774e9 Reviewed-on: https://skia-review.googlesource.com/122784 Commit-Queue: Greg Daniel Reviewed-by: Robert Phillips --- src/gpu/vk/GrVkGpuCommandBuffer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gpu/vk') diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp index bcaeb604c6..5493dd9890 100644 --- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp +++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp @@ -190,6 +190,13 @@ void GrVkGpuRTCommandBuffer::submit() { continue; } + // Make sure if we only have a discard load that we execute the discard on the whole image. + // TODO: Once we improve our tracking of discards so that we never end up flushing a discard + // call with no actually ops, remove this. + if (cbInfo.fIsEmpty && cbInfo.fLoadStoreState == LoadStoreState::kStartsWithDiscard) { + cbInfo.fBounds = SkRect::MakeWH(vkRT->width(), vkRT->height()); + } + if (cbInfo.fBounds.intersect(0, 0, SkIntToScalar(fRenderTarget->width()), SkIntToScalar(fRenderTarget->height()))) { -- cgit v1.2.3