diff options
author | Robert Phillips <robertphillips@google.com> | 2017-08-25 12:26:03 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-25 18:52:18 +0000 |
commit | 9b0b32fda4871776eb9afdf9553e523e5c28aa63 (patch) | |
tree | 172d72265154e24ea3a1709b3bc982e6f9aa7da8 /src/gpu/GrRenderTargetOpList.cpp | |
parent | 964a3b05afabb9594aec2f3c1ba1440404ae91c7 (diff) |
Store discard request on the opList and remove GrDiscardOp (take 2)
Change-Id: I2f1bd6f8547895cc8d66cfde42d7d890441d198e
Reviewed-on: https://skia-review.googlesource.com/33460
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetOpList.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp index b947891d90..30bd30d16b 100644 --- a/src/gpu/GrRenderTargetOpList.cpp +++ b/src/gpu/GrRenderTargetOpList.cpp @@ -94,11 +94,13 @@ void GrRenderTargetOpList::onPrepare(GrOpFlushState* flushState) { static std::unique_ptr<GrGpuRTCommandBuffer> create_command_buffer(GrGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin, - bool clearSB) { + GrLoadOp colorLoadOp, + GrColor loadClearColor, + GrLoadOp stencilLoadOp) { static const GrGpuRTCommandBuffer::LoadAndStoreInfo kBasicLoadStoreInfo { - GrGpuRTCommandBuffer::LoadOp::kLoad, - GrGpuRTCommandBuffer::StoreOp::kStore, - GrColor_ILLEGAL + colorLoadOp, + GrStoreOp::kStore, + loadClearColor }; // TODO: @@ -107,8 +109,8 @@ static std::unique_ptr<GrGpuRTCommandBuffer> create_command_buffer(GrGpu* gpu, // Note: we would still need SB loads and stores but they would happen at a // lower level (inside the VK command buffer). const GrGpuRTCommandBuffer::StencilLoadAndStoreInfo stencilLoadAndStoreInfo { - clearSB ? GrGpuRTCommandBuffer::LoadOp::kClear : GrGpuRTCommandBuffer::LoadOp::kLoad, - GrGpuRTCommandBuffer::StoreOp::kStore, + stencilLoadOp, + GrStoreOp::kStore, }; std::unique_ptr<GrGpuRTCommandBuffer> buffer( @@ -140,11 +142,14 @@ bool GrRenderTargetOpList::onExecute(GrOpFlushState* flushState) { TRACE_EVENT0("skia", TRACE_FUNC); #endif + // TODO: at the very least, we want the stencil store op to always be discard (at this + // level). In Vulkan, sub-command buffers would still need to load & store the stencil buffer. std::unique_ptr<GrGpuRTCommandBuffer> commandBuffer = create_command_buffer( flushState->gpu(), fTarget.get()->priv().peekRenderTarget(), fTarget.get()->origin(), - this->requiresStencil()); + fColorLoadOp, fLoadClearColor, + fStencilLoadOp); flushState->setCommandBuffer(commandBuffer.get()); commandBuffer->begin(); |