Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: src/gpu/GrTargetCommands.cpp

Issue 1040303002: Use texture barriers to read directly from the RT (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_zz1_reverseiter
Patch Set: Add Xfer barriers with glTextureBarrier instead of dst copies Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrTargetCommands.cpp
diff --git a/src/gpu/GrTargetCommands.cpp b/src/gpu/GrTargetCommands.cpp
index 9b968dc9e73650c0501fd9786a1e0901bcef2e18..fa807251240f5cffe077967cfe950a0efe79d0fa 100644
--- a/src/gpu/GrTargetCommands.cpp
+++ b/src/gpu/GrTargetCommands.cpp
@@ -402,6 +402,10 @@ void GrTargetCommands::CopySurface::execute(GrGpu* gpu, const SetState*) {
gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint);
}
+void GrTargetCommands::XferBarrier::execute(GrGpu* gpu, const SetState* state) {
+ gpu->setXferBarrier(fBarrierType);
+}
+
GrTargetCommands::Cmd* GrTargetCommands::recordCopySurface(GrInOrderDrawBuffer* iodb,
GrSurface* dst,
GrSurface* src,
@@ -441,6 +445,8 @@ bool GrTargetCommands::setupPipelineAndShouldDraw(GrInOrderDrawBuffer* iodb,
fPrevState = ss;
iodb->recordTraceMarkersIfNecessary(ss);
}
+
+ this->recordXferBarrierIfNecessary(iodb, pipelineInfo);
return true;
}
@@ -465,6 +471,27 @@ bool GrTargetCommands::setupPipelineAndShouldDraw(GrInOrderDrawBuffer* iodb,
fPrevState = ss;
iodb->recordTraceMarkersIfNecessary(ss);
}
+
+ this->recordXferBarrierIfNecessary(iodb, pipelineInfo);
return true;
}
+void GrTargetCommands::recordXferBarrierIfNecessary(GrInOrderDrawBuffer* iodb,
+ const GrDrawTarget::PipelineInfo& info) {
+ SkASSERT(fPrevState);
+ const GrXferProcessor& xp = *fPrevState->getXferProcessor();
+ GrRenderTarget* rt = fPrevState->getRenderTarget();
+
+ GrXferBarrierType barrierType;
+ if (!xp.willNeedXferBarrier(rt, *iodb->caps(), &barrierType)) {
+ return;
+ }
+
+ this->closeBatch();
+
+ XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, XferBarrier, ());
+ xb->fBarrierType = barrierType;
+
+ iodb->recordTraceMarkersIfNecessary(xb);
+}
+
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | src/gpu/GrTest.cpp » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698