Commit 3e017cfe by Cody Northrop Committed by Commit Bot

Tests: Use context version from trace

Test: Capture and replay ES 3.2 apps Bug: angleproject:5652 Change-Id: Ib46250acd8a50390f0cbd40853623cdf31bd0203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2698392 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent 264eab21
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"src/tests/restricted_traces/free_fire.tar.gz.sha1": "src/tests/restricted_traces/free_fire.tar.gz.sha1":
"a4e7aba54fb48524bb4f3022623bc7cd", "a4e7aba54fb48524bb4f3022623bc7cd",
"src/tests/restricted_traces/gen_restricted_traces.py": "src/tests/restricted_traces/gen_restricted_traces.py":
"eccb9514e9606eb56b24cf57598e596c", "7df2fbfb890d54ea9932b443439ae97e",
"src/tests/restricted_traces/google_maps.tar.gz.sha1": "src/tests/restricted_traces/google_maps.tar.gz.sha1":
"5d7001969619570e80e5a39b1ab8b0c4", "5d7001969619570e80e5a39b1ab8b0c4",
"src/tests/restricted_traces/happy_color.tar.gz.sha1": "src/tests/restricted_traces/happy_color.tar.gz.sha1":
...@@ -86,11 +86,11 @@ ...@@ -86,11 +86,11 @@
"src/tests/restricted_traces/restricted_traces.json": "src/tests/restricted_traces/restricted_traces.json":
"030dab939ec64fcdabdfbe6b05662e53", "030dab939ec64fcdabdfbe6b05662e53",
"src/tests/restricted_traces/restricted_traces_autogen.cpp": "src/tests/restricted_traces/restricted_traces_autogen.cpp":
"aea362cf1696f1014b8751c584748190", "8c3d796ac3b9bafd3a84cb33a708706a",
"src/tests/restricted_traces/restricted_traces_autogen.gni": "src/tests/restricted_traces/restricted_traces_autogen.gni":
"16b9118b91f903331c934c7b1786fe7f", "16b9118b91f903331c934c7b1786fe7f",
"src/tests/restricted_traces/restricted_traces_autogen.h": "src/tests/restricted_traces/restricted_traces_autogen.h":
"d3e0d3469baea6837bcaae8a9d85a5d0", "8eb2d7cf7be4d567a041e219e2192a18",
"src/tests/restricted_traces/rise_of_kingdoms.tar.gz.sha1": "src/tests/restricted_traces/rise_of_kingdoms.tar.gz.sha1":
"d4618f857c44f0dfa642ae3af8f161d9", "d4618f857c44f0dfa642ae3af8f161d9",
"src/tests/restricted_traces/romancing_saga.tar.gz.sha1": "src/tests/restricted_traces/romancing_saga.tar.gz.sha1":
......
...@@ -34,9 +34,6 @@ struct TracePerfParams final : public RenderTestParams ...@@ -34,9 +34,6 @@ struct TracePerfParams final : public RenderTestParams
// Common default options // Common default options
TracePerfParams() TracePerfParams()
{ {
majorVersion = 3;
minorVersion = 1;
// Display the frame after every drawBenchmark invocation // Display the frame after every drawBenchmark invocation
iterationsPerStep = 1; iterationsPerStep = 1;
} }
...@@ -949,6 +946,8 @@ TracePerfParams CombineTestID(const TracePerfParams &in, RestrictedTraceID id) ...@@ -949,6 +946,8 @@ TracePerfParams CombineTestID(const TracePerfParams &in, RestrictedTraceID id)
TracePerfParams out = in; TracePerfParams out = in;
out.testID = id; out.testID = id;
out.majorVersion = traceInfo.contextClientMajorVersion;
out.minorVersion = traceInfo.contextClientMinorVersion;
out.windowWidth = traceInfo.drawSurfaceWidth; out.windowWidth = traceInfo.drawSurfaceWidth;
out.windowHeight = traceInfo.drawSurfaceHeight; out.windowHeight = traceInfo.drawSurfaceHeight;
return out; return out;
......
...@@ -97,8 +97,13 @@ using SetBinaryDataDirFunc = void (*)(const char *); ...@@ -97,8 +97,13 @@ using SetBinaryDataDirFunc = void (*)(const char *);
static constexpr size_t kTraceInfoMaxNameLen = 32; static constexpr size_t kTraceInfoMaxNameLen = 32;
static constexpr uint32_t kDefaultReplayContextClientMajorVersion = 3;
static constexpr uint32_t kDefaultReplayContextClientMinorVersion = 1;
struct TraceInfo struct TraceInfo
{{ {{
uint32_t contextClientMajorVersion;
uint32_t contextClientMinorVersion;
uint32_t startFrame; uint32_t startFrame;
uint32_t endFrame; uint32_t endFrame;
uint32_t drawSurfaceWidth; uint32_t drawSurfaceWidth;
...@@ -264,12 +269,32 @@ def gen_gni(traces, gni_file, format_args): ...@@ -264,12 +269,32 @@ def gen_gni(traces, gni_file, format_args):
return True return True
def contains_context_version(trace):
"Determines if the trace contains the major/minor context version"
for file in os.listdir(trace):
if fnmatch.fnmatch(file, '*.h'):
with open(os.path.join(trace, file)) as f:
if 'kReplayContextClientMajorVersion' in f.read():
return True
return False
def get_trace_info(trace): def get_trace_info(trace):
info = [ # Some traces don't contain major/minor version, so use defaults
info = []
defaults = ''
if contains_context_version(trace):
info += ["%s::kReplayContextClientMajorVersion", "%s::kReplayContextClientMinorVersion"]
else:
defaults = "kDefaultReplayContextClientMajorVersion, kDefaultReplayContextClientMinorVersion,"
info += [
"%s::kReplayFrameStart", "%s::kReplayFrameEnd", "%s::kReplayDrawSurfaceWidth", "%s::kReplayFrameStart", "%s::kReplayFrameEnd", "%s::kReplayDrawSurfaceWidth",
"%s::kReplayDrawSurfaceHeight", "\"%s\"" "%s::kReplayDrawSurfaceHeight", "\"%s\""
] ]
return ", ".join([element % trace for element in info])
merged_info = defaults + ", ".join([element % trace for element in info])
return merged_info
def get_context(trace): def get_context(trace):
......
...@@ -119,8 +119,13 @@ using SetBinaryDataDirFunc = void (*)(const char *); ...@@ -119,8 +119,13 @@ using SetBinaryDataDirFunc = void (*)(const char *);
static constexpr size_t kTraceInfoMaxNameLen = 32; static constexpr size_t kTraceInfoMaxNameLen = 32;
static constexpr uint32_t kDefaultReplayContextClientMajorVersion = 3;
static constexpr uint32_t kDefaultReplayContextClientMinorVersion = 1;
struct TraceInfo struct TraceInfo
{ {
uint32_t contextClientMajorVersion;
uint32_t contextClientMinorVersion;
uint32_t startFrame; uint32_t startFrame;
uint32_t endFrame; uint32_t endFrame;
uint32_t drawSurfaceWidth; uint32_t drawSurfaceWidth;
......
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