aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetOpList.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-25 20:36:18 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-25 20:36:39 +0000
commit445b5573613179c10d5d9c28f82aa8ed94390aea (patch)
tree771dc920056c2b2040de7e07187a6c9e4acbcda2 /src/gpu/GrRenderTargetOpList.cpp
parent54ef7c057ac9cc8ff9cb18eba864686dd59c2d93 (diff)
Revert "Store discard request on the opList and remove GrDiscardOp (take 2)"
This reverts commit 9b0b32fda4871776eb9afdf9553e523e5c28aa63. Reason for revert: Android_Vulkan Gold images are broken Original change's description: > 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> TBR=egdaniel@google.com,robertphillips@google.com Change-Id: I1470d88c2407864da8b6ebdc119c8c2466a2a6c6 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/39000 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 30bd30d16b..b947891d90 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -94,13 +94,11 @@ void GrRenderTargetOpList::onPrepare(GrOpFlushState* flushState) {
static std::unique_ptr<GrGpuRTCommandBuffer> create_command_buffer(GrGpu* gpu,
GrRenderTarget* rt,
GrSurfaceOrigin origin,
- GrLoadOp colorLoadOp,
- GrColor loadClearColor,
- GrLoadOp stencilLoadOp) {
+ bool clearSB) {
static const GrGpuRTCommandBuffer::LoadAndStoreInfo kBasicLoadStoreInfo {
- colorLoadOp,
- GrStoreOp::kStore,
- loadClearColor
+ GrGpuRTCommandBuffer::LoadOp::kLoad,
+ GrGpuRTCommandBuffer::StoreOp::kStore,
+ GrColor_ILLEGAL
};
// TODO:
@@ -109,8 +107,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 {
- stencilLoadOp,
- GrStoreOp::kStore,
+ clearSB ? GrGpuRTCommandBuffer::LoadOp::kClear : GrGpuRTCommandBuffer::LoadOp::kLoad,
+ GrGpuRTCommandBuffer::StoreOp::kStore,
};
std::unique_ptr<GrGpuRTCommandBuffer> buffer(
@@ -142,14 +140,11 @@ 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(),
- fColorLoadOp, fLoadClearColor,
- fStencilLoadOp);
+ this->requiresStencil());
flushState->setCommandBuffer(commandBuffer.get());
commandBuffer->begin();