+ 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;
+}
+
+void
+TraceAnalyzer::recordSideEffects(trace::Call *call)
+{
+
+ const char *name = call->name();
+
+ /* FIXME: If we encode the list of commands that are executed
+ * immediately (as opposed to those that are compiled into a
+ * display list) then we could generate a "display-list-X"
+ * resource just as we do for "texture-X" resources and only
+ * emit it in the trace if a glCallList(X) is emitted. For
+ * now, simply punt and include anything within glNewList and
+ * glEndList in the trim output. This guarantees that display
+ * lists will work, but does not trim out unused display
+ * lists. */
+ if (insideNewEndList != 0) {
+ provide("state", call->no);
+
+ /* Also, any texture bound inside a display list is
+ * conservatively considered required. */
+ if (strcmp(name, "glBindTexture") == 0) {
+ GLuint texture = call->arg(1).toUInt();
+
+ linkf("state", "texture-", texture);
+ }
+