Commit 3a909841 by Cody Northrop Committed by Commit Bot

Perf: Add Reset call to trace tests

The traces are already updated to contain the Reset calls, now actually call them from TracePerfTests. Test: angle_perftests --gtest_filter="*Trace*" Bug: b/152512564 Bug: angleproject:4599 Change-Id: I18b6726bc98b96f132c3245c51420cbfed1b84d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2197284Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 544a80ef
{ {
"src/tests/perf_tests/restricted_traces/gen_restricted_traces.py": "src/tests/perf_tests/restricted_traces/gen_restricted_traces.py":
"ff51ca78ed52c33ddfcc4a7e795f217c", "f61ccd2c8ce98674527909d567083963",
"src/tests/perf_tests/restricted_traces/manhattan_10.tar.gz.sha1": "src/tests/perf_tests/restricted_traces/manhattan_10.tar.gz.sha1":
"b4d333cd5cf3977c339350be0a819928", "b4d333cd5cf3977c339350be0a819928",
"src/tests/perf_tests/restricted_traces/restricted_traces.json": "src/tests/perf_tests/restricted_traces/restricted_traces.json":
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.gni": "src/tests/perf_tests/restricted_traces/restricted_traces_autogen.gni":
"54343c0c0a3a15f076516ad26f2ada5a", "54343c0c0a3a15f076516ad26f2ada5a",
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.h": "src/tests/perf_tests/restricted_traces/restricted_traces_autogen.h":
"d0b8cfda99009a6e042989ffa0ea3608", "e08aec5cfa97c2239e3cccc6afccb1b0",
"src/tests/perf_tests/restricted_traces/trex_200.tar.gz.sha1": "src/tests/perf_tests/restricted_traces/trex_200.tar.gz.sha1":
"605cf71846da2309a002baa78abf28e1" "605cf71846da2309a002baa78abf28e1"
} }
\ No newline at end of file
...@@ -190,6 +190,8 @@ void TracePerfTest::drawBenchmark() ...@@ -190,6 +190,8 @@ void TracePerfTest::drawBenchmark()
endInternalTraceEvent(frameName); endInternalTraceEvent(frameName);
} }
ResetReplay(GetParam().testID);
// Process any running queries once per iteration. // Process any running queries once per iteration.
for (size_t queryIndex = 0; queryIndex < mRunningQueries.size();) for (size_t queryIndex = 0; queryIndex < mRunningQueries.size();)
{ {
......
...@@ -49,6 +49,7 @@ enum class RestrictedTraceID ...@@ -49,6 +49,7 @@ enum class RestrictedTraceID
}}; }};
using ReplayFunc = void (*)(uint32_t); using ReplayFunc = void (*)(uint32_t);
using ResetFunc = void (*)();
using SetupFunc = void (*)(); using SetupFunc = void (*)();
using DecompressFunc = uint8_t *(*)(const std::vector<uint8_t> &); using DecompressFunc = uint8_t *(*)(const std::vector<uint8_t> &);
using SetBinaryDataDirFunc = void (*)(const char *); using SetBinaryDataDirFunc = void (*)(const char *);
...@@ -81,6 +82,18 @@ inline void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex) ...@@ -81,6 +82,18 @@ inline void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex)
}} }}
}} }}
inline void ResetReplay(RestrictedTraceID traceID)
{{
switch (traceID)
{{
{reset_func_cases}
default:
fprintf(stderr, "Error in switch.\\n");
assert(0);
break;
}}
}}
inline void SetupReplay(RestrictedTraceID traceID) inline void SetupReplay(RestrictedTraceID traceID)
{{ {{
switch (traceID) switch (traceID)
...@@ -206,6 +219,7 @@ def gen_header(traces, header_file, format_args): ...@@ -206,6 +219,7 @@ def gen_header(traces, header_file, format_args):
format_args["trace_infos"] = ",\n".join(trace_infos) format_args["trace_infos"] = ",\n".join(trace_infos)
format_args["replay_func_cases"] = get_cases_with_context(traces, "ReplayContext", "Frame", format_args["replay_func_cases"] = get_cases_with_context(traces, "ReplayContext", "Frame",
"frameIndex") "frameIndex")
format_args["reset_func_cases"] = get_cases_with_context(traces, "ResetContext", "Replay", "")
format_args["setup_func_cases"] = get_cases_with_context(traces, "SetupContext", "Replay", "") format_args["setup_func_cases"] = get_cases_with_context(traces, "SetupContext", "Replay", "")
format_args["set_binary_data_dir_cases"] = get_cases(traces, "SetBinaryDataDir", "dataDir") format_args["set_binary_data_dir_cases"] = get_cases(traces, "SetBinaryDataDir", "dataDir")
format_args["decompress_callback_cases"] = get_cases(traces, "SetBinaryDataDecompressCallback", format_args["decompress_callback_cases"] = get_cases(traces, "SetBinaryDataDecompressCallback",
......
...@@ -24,6 +24,7 @@ enum class RestrictedTraceID ...@@ -24,6 +24,7 @@ enum class RestrictedTraceID
}; };
using ReplayFunc = void (*)(uint32_t); using ReplayFunc = void (*)(uint32_t);
using ResetFunc = void (*)();
using SetupFunc = void (*)(); using SetupFunc = void (*)();
using DecompressFunc = uint8_t *(*)(const std::vector<uint8_t> &); using DecompressFunc = uint8_t *(*)(const std::vector<uint8_t> &);
using SetBinaryDataDirFunc = void (*)(const char *); using SetBinaryDataDirFunc = void (*)(const char *);
...@@ -63,6 +64,23 @@ inline void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex) ...@@ -63,6 +64,23 @@ inline void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex)
} }
} }
inline void ResetReplay(RestrictedTraceID traceID)
{
switch (traceID)
{
case RestrictedTraceID::manhattan_10:
manhattan_10::ResetContext1Replay();
break;
case RestrictedTraceID::trex_200:
trex_200::ResetContext1Replay();
break;
default:
fprintf(stderr, "Error in switch.\n");
assert(0);
break;
}
}
inline void SetupReplay(RestrictedTraceID traceID) inline void SetupReplay(RestrictedTraceID traceID)
{ {
switch (traceID) switch (traceID)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment