[PATCH] retrace: Implement glxCopySubBufferMESA

Carl Worth cworth at cworth.org
Mon Oct 28 13:29:16 PDT 2013


José Fonseca <jose.r.fonseca at gmail.com> writes:
> On Mon, Oct 21, 2013 at 5:54 PM, Alexander Monakov <amonakov at ispras.ru>wrote:
>> My preference would be to issue a warning and continue replaying; this is
>> what
>> happens on GLX if the underlying driver does not implement this function.
>
> Yes, I also think that a warning would be more consistent with what we
> handle elsewhere. We tend to only abort on context/device initialization,
> as that tends to lead to crashes anyway.
>
> Otherwise it also looks good to me.

You're both right, of course. Prior to the patch, the replay would just
emit a warning and continue replay on GLX, so this shouldn't introduce a
new fatal error.

>> Other than that, I looked at the patch and it looks good to me.

OK. I've just pushed a version with just a warning.

>> I'll note that this function, like glFinish and glFlush, is almost, but not
>> quite, a candidate for "this call concludes drawing a frame" flag.

You're definitely right. It's strange to replay this chrome trace with
apparently hundreds of frames in it only to then see:

	Rendered 6 frames in 10.9526 secs, average of 0.547816 fps

I'm not sure what you mean with "almost, but not quite". I did find at
least two places in the code that seemed appropriate to make this
change, (see the patch below). The extra call to frame_complete fixes
this particular trace to now report:

	Rendered 1393 frames in 12.0835 secs, average of 115.281 fps

I'm not sure if the CALL_FLAG_SWAPBUFFERS addition is also wanted or
not.

-Carl

From 179e5bd7787cc8cc173a88b12038b830be79ef5e Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth at cworth.org>
Date: Mon, 28 Oct 2013 13:26:14 -0700
Subject: [PATCH] Treat glXCopySubBufferMESA as a frame terminator.

Chrome, at least, is using this call as a frame terminator, so frames
are undercounted when replaying chrome traces without this change.
---
 common/trace_parser_flags.cpp | 1 +
 retrace/glretrace_glx.cpp     | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/common/trace_parser_flags.cpp b/common/trace_parser_flags.cpp
index 06fdc94..b693150 100644
--- a/common/trace_parser_flags.cpp
+++ b/common/trace_parser_flags.cpp
@@ -524,6 +524,7 @@ callFlagTable[] = {
     { "glPushDebugGroup",                              /* CALL_FLAG_NO_SIDE_EFFECTS | */ CALL_FLAG_MARKER | CALL_FLAG_MARKER_PUSH },
     { "glPushGroupMarkerEXT",                          /* CALL_FLAG_NO_SIDE_EFFECTS | */ CALL_FLAG_MARKER | CALL_FLAG_MARKER_PUSH },
     { "glStringMarkerGREMEDY",                         /* CALL_FLAG_NO_SIDE_EFFECTS | */ CALL_FLAG_MARKER },
+    { "glXCopySubBufferMESA",                          CALL_FLAG_SWAPBUFFERS },
     { "glXGetClientString",                            CALL_FLAG_NO_SIDE_EFFECTS | CALL_FLAG_VERBOSE },
     { "glXGetCurrentContext",                          CALL_FLAG_NO_SIDE_EFFECTS | CALL_FLAG_VERBOSE },
     { "glXGetCurrentDisplay",                          CALL_FLAG_NO_SIDE_EFFECTS | CALL_FLAG_VERBOSE },
diff --git a/retrace/glretrace_glx.cpp b/retrace/glretrace_glx.cpp
index 7efc3bf..062ef3e 100644
--- a/retrace/glretrace_glx.cpp
+++ b/retrace/glretrace_glx.cpp
@@ -118,6 +118,8 @@ static void retrace_glXCopySubBufferMESA(trace::Call &call) {
     int width = call.arg(4).toSInt();
     int height = call.arg(5).toSInt();
 
+    frame_complete(call);
+
     drawable->copySubBuffer(x, y, width, height);
 }
 
-- 
1.8.4.rc3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20131028/ef4b7c17/attachment.pgp>


More information about the apitrace mailing list