]> git.cworth.org Git - apitrace/blobdiff - cli/trace_analyzer.cpp
trim: Trim swapbuffers calls when --trim-spec=drawing
[apitrace] / cli / trace_analyzer.cpp
index 48153f02a50cdd831861dd7c064b0c2899368cd8..730dab91b08d8478d001ed75d319938a2d55894d 100644 (file)
@@ -635,6 +635,13 @@ TraceAnalyzer::recordDrawingSideEffects(trace::Call *call, const char *name)
         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;
 }