From 1d77542f568118a990c237debc517f64977e8397 Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Tue, 3 Dec 2019 15:54:41 -0700 Subject: [PATCH] Add flag to label captures Add an optional parameter (ANGLE_CAPTURE_LABEL) to ANGLE frame capture that tags files and functions uniquely, allowing multiple frame captures to be replayed by a test harness. Example: ANGLE_CAPTURE_LABEL=foo Results in filenames like this: foo_capture_context1.cpp foo_capture_context1.h foo_capture_context1_files.txt foo_capture_context1_frame000.angledata foo_capture_context1_frame000.cpp foo_capture_context1_frame001.angledata foo_capture_context1_frame001.cpp ... Functions wrapped in namespaces like this: namespace foo { void ReplayContext1Frame0(); void ReplayContext1Frame1(); } For use like this: foo::SetupContext1Replay(); for (...) { foo::ReplayContext1Frame(i); } Bug: angleproject:3630 Change-Id: Ibe27dc4d40a36606ee40678a9e4d43b5a4baf976 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1949603 Commit-Queue: Cody Northrop Reviewed-by: Jamie Madill --- doc/CaptureAndReplay.md | 31 +++++++++ src/libANGLE/FrameCapture.cpp | 117 +++++++++++++++++++++++++++------- src/libANGLE/FrameCapture.h | 1 + 3 files changed, 126 insertions(+), 23 deletions(-) diff --git a/doc/CaptureAndReplay.md b/doc/CaptureAndReplay.md index 25eae754e..f677ddae2 100644 --- a/doc/CaptureAndReplay.md +++ b/doc/CaptureAndReplay.md @@ -41,6 +41,36 @@ Some simple environment variables control frame capture: * `ANGLE_CAPTURE_FRAME_END=`: * By default ANGLE will capture the first ten frames. This variable can override the default. * Example: `ANGLE_CAPTURE_FRAME_END=4`. Default is `10`. + * `ANGLE_CAPTURE_LABEL=