[PATCH] retrace: support for dumping multiple snapshots (v2)

Eric Anholt eric at anholt.net
Sat Jan 21 18:30:48 UTC 2017


Rob Clark <robdclark at gmail.com> writes:

> Usually if an app is using MRT, we want to dump (and diff) *all* the
> render targets to track down where things are going wrong.  Also dumps
> depth and stencil buffers.
>
> Only implemented for GLDumper, since I don't know anything about D3D.
>
> TODO maybe cmdline arg to control this?  I'm not sure, I kinda tend to
> think if you are using dump-images + diff-images you probably want to
> compare all the render targets.
> ---
>  retrace/d3dretrace.hpp     |  9 ++++++--
>  retrace/glretrace_main.cpp | 12 +++++++++--
>  retrace/glstate.hpp        |  5 ++++-
>  retrace/glstate_images.cpp | 51 +++++++++++++++++++++++++++++++++++++---------
>  retrace/retrace.hpp        |  5 ++++-
>  retrace/retrace_main.cpp   | 50 ++++++++++++++++++++++++++++++++++++---------
>  6 files changed, 106 insertions(+), 26 deletions(-)
>

> @@ -200,9 +206,24 @@ takeSnapshot(unsigned call_no) {
>                  break;
>              }
>          } else {
> -            os::String filename = os::String::format("%s%010u.png",
> -                                                     snapshotPrefix,
> -                                                     useCallNos ? call_no : snapshot_no);
> +            os::String filename;
> +
> +            if (mrt == -2) {
> +                /* stencil */
> +                filename = os::String::format("%s%010u-s.png",
> +                                              snapshotPrefix,
> +                                              useCallNos ? call_no : snapshot_no);
> +            } else if (mrt == -1) {
> +                /* depth */
> +                filename = os::String::format("%s%010u-z.png",
> +                                              snapshotPrefix,
> +                                              useCallNos ? call_no : snapshot_no);
> +            } else {
> +                filename = os::String::format("%s%010u-mrt%u.png",
> +                                              snapshotPrefix,
> +                                              useCallNos ? call_no : snapshot_no,
> +                                              mrt);
> +            }

The rename here is going to break piglit's testing of color rendering
output.  Could we keep the old filename for the first color buffer, or
could you fix piglit to look for both?

The patch (other than that) seems really useful, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/apitrace/attachments/20170121/e0253653/attachment.sig>


More information about the apitrace mailing list