Commit a4535c18 by Jamie Madill Committed by Commit Bot

Fix trace tests auto-generation.

This moves the trace header inclusion to the cpp file so that the test itself doesn't need to look at the individual trace headers. This fixes an include directory dependency. Also removes the FBO change callback from the generated traces. Bug: angleproject:4845 Change-Id: I019f0d347a62a81b92bf32110572911111212689 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2314217Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 9faf0cdc
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
"src/tests/perf_tests/restricted_traces/egypt_1500.tar.gz.sha1": "src/tests/perf_tests/restricted_traces/egypt_1500.tar.gz.sha1":
"e675648c5b16fc52077998621e6300ba", "e675648c5b16fc52077998621e6300ba",
"src/tests/perf_tests/restricted_traces/gen_restricted_traces.py": "src/tests/perf_tests/restricted_traces/gen_restricted_traces.py":
"b9ab26dab2fd7e4721d5ee9250dcf3a2", "8f72f02cfb21ad18c3558d38b77320cc",
"src/tests/perf_tests/restricted_traces/manhattan_10.tar.gz.sha1": "src/tests/perf_tests/restricted_traces/manhattan_10.tar.gz.sha1":
"7f5e3e8b4d7ec07232c54d41964006ea", "7f5e3e8b4d7ec07232c54d41964006ea",
"src/tests/perf_tests/restricted_traces/restricted_traces.json": "src/tests/perf_tests/restricted_traces/restricted_traces.json":
"de1d1c2086bd4f5249f5bdbdf0d2a854", "de1d1c2086bd4f5249f5bdbdf0d2a854",
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.cpp": "src/tests/perf_tests/restricted_traces/restricted_traces_autogen.cpp":
"17e146f0d8a17a002587d5c26a0db008", "dde7c3ba7d1028a1a684f9c01cd368a9",
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.gni": "src/tests/perf_tests/restricted_traces/restricted_traces_autogen.gni":
"25de059705d29d797e246aae027498ec", "25de059705d29d797e246aae027498ec",
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.h": "src/tests/perf_tests/restricted_traces/restricted_traces_autogen.h":
"5be32477d2803b309f9af3b006732428", "d4a6af9481d496bd66f5b6144f4622ba",
"src/tests/perf_tests/restricted_traces/subway_surfer_500.tar.gz.sha1": "src/tests/perf_tests/restricted_traces/subway_surfer_500.tar.gz.sha1":
"a47a797dd227f5025439b47cee80dbc9", "a47a797dd227f5025439b47cee80dbc9",
"src/tests/perf_tests/restricted_traces/temple_run_300.tar.gz.sha1": "src/tests/perf_tests/restricted_traces/temple_run_300.tar.gz.sha1":
......
...@@ -39,7 +39,8 @@ header_template = """// GENERATED FILE - DO NOT EDIT. ...@@ -39,7 +39,8 @@ header_template = """// GENERATED FILE - DO NOT EDIT.
#ifndef ANGLE_RESTRICTED_TRACES_H_ #ifndef ANGLE_RESTRICTED_TRACES_H_
#define ANGLE_RESTRICTED_TRACES_H_ #define ANGLE_RESTRICTED_TRACES_H_
{includes} #include <cstdint>
#include <vector>
// See util/util_export.h for details on import/export labels. // See util/util_export.h for details on import/export labels.
#if !defined(ANGLE_TRACE_EXPORT) #if !defined(ANGLE_TRACE_EXPORT)
...@@ -81,7 +82,6 @@ struct TraceInfo ...@@ -81,7 +82,6 @@ struct TraceInfo
}}; }};
using DecompressCallback = uint8_t *(*)(const std::vector<uint8_t> &); using DecompressCallback = uint8_t *(*)(const std::vector<uint8_t> &);
using FramebufferChangeCallback = void(*)(void *userData, GLenum target, GLuint framebuffer);
ANGLE_TRACE_EXPORT const TraceInfo &GetTraceInfo(RestrictedTraceID traceID); ANGLE_TRACE_EXPORT const TraceInfo &GetTraceInfo(RestrictedTraceID traceID);
ANGLE_TRACE_EXPORT void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex); ANGLE_TRACE_EXPORT void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex);
...@@ -89,7 +89,6 @@ ANGLE_TRACE_EXPORT void ResetReplay(RestrictedTraceID traceID); ...@@ -89,7 +89,6 @@ ANGLE_TRACE_EXPORT void ResetReplay(RestrictedTraceID traceID);
ANGLE_TRACE_EXPORT void SetupReplay(RestrictedTraceID traceID); ANGLE_TRACE_EXPORT void SetupReplay(RestrictedTraceID traceID);
ANGLE_TRACE_EXPORT void SetBinaryDataDir(RestrictedTraceID traceID, const char *dataDir); ANGLE_TRACE_EXPORT void SetBinaryDataDir(RestrictedTraceID traceID, const char *dataDir);
ANGLE_TRACE_EXPORT void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, DecompressCallback callback); ANGLE_TRACE_EXPORT void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, DecompressCallback callback);
ANGLE_TRACE_EXPORT void SetFramebufferChangeCallback(RestrictedTraceID traceID, void *userData, FramebufferChangeCallback callback);
}} // namespace angle }} // namespace angle
#endif // ANGLE_RESTRICTED_TRACES_H_ #endif // ANGLE_RESTRICTED_TRACES_H_
...@@ -108,6 +107,8 @@ source_template = """// GENERATED FILE - DO NOT EDIT. ...@@ -108,6 +107,8 @@ source_template = """// GENERATED FILE - DO NOT EDIT.
#include "common/PackedEnums.h" #include "common/PackedEnums.h"
{trace_includes}
namespace angle namespace angle
{{ {{
namespace namespace
...@@ -181,18 +182,6 @@ void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, DecompressCallba ...@@ -181,18 +182,6 @@ void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, DecompressCallba
break; break;
}} }}
}} }}
void SetFramebufferChangeCallback(RestrictedTraceID traceID, void *userData, FramebufferChangeCallback callback)
{{
switch (traceID)
{{
{on_fb_change_callback_cases}
default:
fprintf(stderr, "Error in switch.\\n");
assert(0);
break;
}}
}}
}} // namespace angle }} // namespace angle
""" """
...@@ -323,8 +312,8 @@ def main(): ...@@ -323,8 +312,8 @@ def main():
] ]
format_args["filename"] = "restricted_traces_autogen" format_args["filename"] = "restricted_traces_autogen"
format_args["includes"] = "\n".join(includes)
format_args["trace_ids"] = ",\n".join(traces) format_args["trace_ids"] = ",\n".join(traces)
format_args["trace_includes"] = "\n".join(includes)
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")
...@@ -333,8 +322,6 @@ def main(): ...@@ -333,8 +322,6 @@ def main():
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",
"callback") "callback")
format_args["on_fb_change_callback_cases"] = get_cases(traces, "SetFramebufferChangeCallback",
"userData, callback")
if not gen_header(header_file, format_args): if not gen_header(header_file, format_args):
print('.h file generation failed.') print('.h file generation failed.')
return 1 return 1
......
...@@ -11,6 +11,14 @@ ...@@ -11,6 +11,14 @@
#include "common/PackedEnums.h" #include "common/PackedEnums.h"
#include "angry_birds_2_1500/angry_birds_2_1500_capture_context3.h"
#include "candy_crush_500/candy_crush_500_capture_context2.h"
#include "egypt_1500/egypt_1500_capture_context1.h"
#include "manhattan_10/manhattan_10_capture_context1.h"
#include "subway_surfer_500/subway_surfer_500_capture_context4.h"
#include "temple_run_300/temple_run_300_capture_context3.h"
#include "trex_200/trex_200_capture_context1.h"
namespace angle namespace angle
{ {
namespace namespace
...@@ -208,38 +216,4 @@ void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, DecompressCallba ...@@ -208,38 +216,4 @@ void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, DecompressCallba
break; break;
} }
} }
void SetFramebufferChangeCallback(RestrictedTraceID traceID,
void *userData,
FramebufferChangeCallback callback)
{
switch (traceID)
{
case RestrictedTraceID::angry_birds_2_1500:
angry_birds_2_1500::SetFramebufferChangeCallback(userData, callback);
break;
case RestrictedTraceID::candy_crush_500:
candy_crush_500::SetFramebufferChangeCallback(userData, callback);
break;
case RestrictedTraceID::egypt_1500:
egypt_1500::SetFramebufferChangeCallback(userData, callback);
break;
case RestrictedTraceID::manhattan_10:
manhattan_10::SetFramebufferChangeCallback(userData, callback);
break;
case RestrictedTraceID::subway_surfer_500:
subway_surfer_500::SetFramebufferChangeCallback(userData, callback);
break;
case RestrictedTraceID::temple_run_300:
temple_run_300::SetFramebufferChangeCallback(userData, callback);
break;
case RestrictedTraceID::trex_200:
trex_200::SetFramebufferChangeCallback(userData, callback);
break;
default:
fprintf(stderr, "Error in switch.\n");
assert(0);
break;
}
}
} // namespace angle } // namespace angle
...@@ -10,13 +10,8 @@ ...@@ -10,13 +10,8 @@
#ifndef ANGLE_RESTRICTED_TRACES_H_ #ifndef ANGLE_RESTRICTED_TRACES_H_
#define ANGLE_RESTRICTED_TRACES_H_ #define ANGLE_RESTRICTED_TRACES_H_
#include "angry_birds_2_1500/angry_birds_2_1500_capture_context3.h" #include <cstdint>
#include "candy_crush_500/candy_crush_500_capture_context2.h" #include <vector>
#include "egypt_1500/egypt_1500_capture_context1.h"
#include "manhattan_10/manhattan_10_capture_context1.h"
#include "subway_surfer_500/subway_surfer_500_capture_context4.h"
#include "temple_run_300/temple_run_300_capture_context3.h"
#include "trex_200/trex_200_capture_context1.h"
// See util/util_export.h for details on import/export labels. // See util/util_export.h for details on import/export labels.
#if !defined(ANGLE_TRACE_EXPORT) #if !defined(ANGLE_TRACE_EXPORT)
...@@ -65,8 +60,7 @@ struct TraceInfo ...@@ -65,8 +60,7 @@ struct TraceInfo
char name[kTraceInfoMaxNameLen]; char name[kTraceInfoMaxNameLen];
}; };
using DecompressCallback = uint8_t *(*)(const std::vector<uint8_t> &); using DecompressCallback = uint8_t *(*)(const std::vector<uint8_t> &);
using FramebufferChangeCallback = void (*)(void *userData, GLenum target, GLuint framebuffer);
ANGLE_TRACE_EXPORT const TraceInfo &GetTraceInfo(RestrictedTraceID traceID); ANGLE_TRACE_EXPORT const TraceInfo &GetTraceInfo(RestrictedTraceID traceID);
ANGLE_TRACE_EXPORT void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex); ANGLE_TRACE_EXPORT void ReplayFrame(RestrictedTraceID traceID, uint32_t frameIndex);
...@@ -75,9 +69,6 @@ ANGLE_TRACE_EXPORT void SetupReplay(RestrictedTraceID traceID); ...@@ -75,9 +69,6 @@ ANGLE_TRACE_EXPORT void SetupReplay(RestrictedTraceID traceID);
ANGLE_TRACE_EXPORT void SetBinaryDataDir(RestrictedTraceID traceID, const char *dataDir); ANGLE_TRACE_EXPORT void SetBinaryDataDir(RestrictedTraceID traceID, const char *dataDir);
ANGLE_TRACE_EXPORT void SetBinaryDataDecompressCallback(RestrictedTraceID traceID, ANGLE_TRACE_EXPORT void SetBinaryDataDecompressCallback(RestrictedTraceID traceID,
DecompressCallback callback); DecompressCallback callback);
ANGLE_TRACE_EXPORT void SetFramebufferChangeCallback(RestrictedTraceID traceID,
void *userData,
FramebufferChangeCallback callback);
} // namespace angle } // namespace angle
#endif // ANGLE_RESTRICTED_TRACES_H_ #endif // ANGLE_RESTRICTED_TRACES_H_
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