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

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: fix windows build 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
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTargetCommands.cpp
diff --git a/src/gpu/GrTargetCommands.cpp b/src/gpu/GrTargetCommands.cpp
index c448db95b64a1bd56da6eb53b7cacc6e09782dbc..24ee32d83218f97479fbed65ea68fabc341fae6d 100644
--- a/src/gpu/GrTargetCommands.cpp
+++ b/src/gpu/GrTargetCommands.cpp
@@ -341,6 +341,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->xferBarrier(fBarrierType);
+}
+
GrTargetCommands::Cmd* GrTargetCommands::recordCopySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
@@ -375,6 +379,8 @@ bool GrTargetCommands::setupPipelineAndShouldDraw(GrInOrderDrawBuffer* iodb,
fPrevState = ss;
iodb->recordTraceMarkersIfNecessary(ss);
}
+
+ this->recordXferBarrierIfNecessary(iodb, pipelineInfo);
return true;
}
@@ -398,6 +404,25 @@ 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;
+ }
+
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698