aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetOpList.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-08-24 15:59:33 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-24 20:18:27 +0000
commit500d58b2a6e6fd03239622da42b67b2c9843b7be (patch)
treedc77637f3bbcc07773c3bdbd292870c59f28e333 /src/gpu/GrRenderTargetOpList.cpp
parentfb126fa96e0f49f5dc17a9a043acced68be99e93 (diff)
Make Copy Ops to go through GpuCommandBuffer instead of straigt to GPU.
Bug: skia: Change-Id: I4eae4507e07278997e26419e94586eef0780c423 Reviewed-on: https://skia-review.googlesource.com/38361 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp42
1 files changed, 13 insertions, 29 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index ca449d30d3..b947891d90 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -91,13 +91,13 @@ void GrRenderTargetOpList::onPrepare(GrOpFlushState* flushState) {
}
}
-static std::unique_ptr<GrGpuCommandBuffer> create_command_buffer(GrGpu* gpu,
- GrRenderTarget* rt,
- GrSurfaceOrigin origin,
- bool clearSB) {
- static const GrGpuCommandBuffer::LoadAndStoreInfo kBasicLoadStoreInfo {
- GrGpuCommandBuffer::LoadOp::kLoad,
- GrGpuCommandBuffer::StoreOp::kStore,
+static std::unique_ptr<GrGpuRTCommandBuffer> create_command_buffer(GrGpu* gpu,
+ GrRenderTarget* rt,
+ GrSurfaceOrigin origin,
+ bool clearSB) {
+ static const GrGpuRTCommandBuffer::LoadAndStoreInfo kBasicLoadStoreInfo {
+ GrGpuRTCommandBuffer::LoadOp::kLoad,
+ GrGpuRTCommandBuffer::StoreOp::kStore,
GrColor_ILLEGAL
};
@@ -106,19 +106,19 @@ static std::unique_ptr<GrGpuCommandBuffer> create_command_buffer(GrGpu* gpu,
// to stop splitting up higher level opLists for copyOps to achieve that.
// Note: we would still need SB loads and stores but they would happen at a
// lower level (inside the VK command buffer).
- const GrGpuCommandBuffer::StencilLoadAndStoreInfo stencilLoadAndStoreInfo {
- clearSB ? GrGpuCommandBuffer::LoadOp::kClear : GrGpuCommandBuffer::LoadOp::kLoad,
- GrGpuCommandBuffer::StoreOp::kStore,
+ const GrGpuRTCommandBuffer::StencilLoadAndStoreInfo stencilLoadAndStoreInfo {
+ clearSB ? GrGpuRTCommandBuffer::LoadOp::kClear : GrGpuRTCommandBuffer::LoadOp::kLoad,
+ GrGpuRTCommandBuffer::StoreOp::kStore,
};
- std::unique_ptr<GrGpuCommandBuffer> buffer(
+ std::unique_ptr<GrGpuRTCommandBuffer> buffer(
gpu->createCommandBuffer(rt, origin,
kBasicLoadStoreInfo, // Color
stencilLoadAndStoreInfo)); // Stencil
return buffer;
}
-static inline void finish_command_buffer(GrGpuCommandBuffer* buffer) {
+static inline void finish_command_buffer(GrGpuRTCommandBuffer* buffer) {
if (!buffer) {
return;
}
@@ -140,7 +140,7 @@ bool GrRenderTargetOpList::onExecute(GrOpFlushState* flushState) {
TRACE_EVENT0("skia", TRACE_FUNC);
#endif
- std::unique_ptr<GrGpuCommandBuffer> commandBuffer = create_command_buffer(
+ std::unique_ptr<GrGpuRTCommandBuffer> commandBuffer = create_command_buffer(
flushState->gpu(),
fTarget.get()->priv().peekRenderTarget(),
fTarget.get()->origin(),
@@ -157,22 +157,6 @@ bool GrRenderTargetOpList::onExecute(GrOpFlushState* flushState) {
TRACE_EVENT0("skia", fRecordedOps[i].fOp->name());
#endif
- if (fRecordedOps[i].fOp->needsCommandBufferIsolation()) {
- // This op is a special snowflake and must occur between command buffers
- // TODO: make this go through the command buffer
- finish_command_buffer(commandBuffer.get());
-
- commandBuffer.reset();
- flushState->setCommandBuffer(commandBuffer.get());
- } else if (!commandBuffer) {
- commandBuffer = create_command_buffer(flushState->gpu(),
- fTarget.get()->priv().peekRenderTarget(),
- fTarget.get()->origin(),
- false);
- flushState->setCommandBuffer(commandBuffer.get());
- commandBuffer->begin();
- }
-
GrOpFlushState::DrawOpArgs opArgs {
fTarget.get()->asRenderTargetProxy(),
fRecordedOps[i].fAppliedClip,