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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1137663004: Don't issue texture barriers for RT's with separate storage (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_oreq
Patch Set: rebase Created 5 years, 7 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/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 3d7d6918f1ef89e52fee24f7a583bdd29209f716..6d97804fc65ffa52ddf350c58cd9d6f2b0232723 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2787,12 +2787,20 @@ bool GrGLGpu::canCopySurface(const GrSurface* dst,
return false;
}
-void GrGLGpu::xferBarrier(GrXferBarrierType type) {
+void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) {
switch (type) {
- case kTexture_GrXferBarrierType:
+ case kTexture_GrXferBarrierType: {
+ GrGLRenderTarget* glrt = static_cast<GrGLRenderTarget*>(rt);
+ if (glrt->textureFBOID() != glrt->renderFBOID()) {
+ // The render target uses separate storage so no need for glTextureBarrier.
+ // FIXME: The render target will resolve automatically when its texture is bound,
+ // but we could resolve only the bounds that will be read if we do it here instead.
+ return;
+ }
SkASSERT(this->caps()->textureBarrierSupport());
GL_CALL(TextureBarrier());
return;
+ }
case kBlend_GrXferBarrierType:
SkASSERT(GrDrawTargetCaps::kAdvanced_BlendEquationSupport ==
this->caps()->blendEquationSupport());
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698