]> git.cworth.org Git - apitrace/commitdiff
trim: Trim swapbuffers calls when --trim-spec=drawing
authorCarl Worth <cworth@cworth.org>
Fri, 16 Nov 2012 20:41:52 +0000 (12:41 -0800)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 6 Feb 2013 15:46:20 +0000 (15:46 +0000)
Previously, the SwapBuffers calls were only getting trimmed if
--trim-spec included "no-side-effects". It was counter-intuitive that
a trim-spec of "drawing" alone would leave all the SwapBuffers calls
in place. So catch them under this trim-spec as well.

cli/trace_analyzer.cpp

index 48153f02a50cdd831861dd7c064b0c2899368cd8..730dab91b08d8478d001ed75d319938a2d55894d 100644 (file)
@@ -635,6 +635,13 @@ TraceAnalyzer::recordDrawingSideEffects(trace::Call *call, const char *name)
         return true;
     }
 
         return true;
     }
 
+    /* Though it's not flagged as a "RENDER" operation, we also want
+     * to trim swapbuffers calls when trimming drawing operations. */
+    if (call->flags & trace::CALL_FLAG_SWAP_RENDERTARGET &&
+        call->flags & trace::CALL_FLAG_END_FRAME) {
+        return true;
+    }
+
     /* No known drawing-related side effects. Return false for more analysis. */
     return false;
 }
     /* No known drawing-related side effects. Return false for more analysis. */
     return false;
 }