#ifndef ANGLE_TRACE_INTERPRETER_H_
#define ANGLE_TRACE_INTERPRETER_H_
#include "common/frame_capture_utils.h"
#include "frame_capture_test_utils.h"
#include "traces_export.h"
namespace angle
{
struct TraceString
{ … };
TraceStringMap;
constexpr size_t kMaxTokenSize = …;
constexpr size_t kMaxParameters = …;
Token;
CallCapture ParseCallCapture(const Token &nameToken,
size_t numParamTokens,
const Token *paramTokens,
const TraceStringMap &strings);
template <typename T>
void PackParameter(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<uint32_t>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<int32_t>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<void *>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<const int32_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<void **>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<int32_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<uint64_t>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<int64_t>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<const int64_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<int64_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<uint64_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const char *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const void *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<uint32_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const uint32_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<float>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<uint8_t>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<float *>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<const float *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<GLsync>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<const char *const *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const char **>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<GLDEBUGPROCKHR>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<EGLDEBUGPROCKHR>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const struct AHardwareBuffer *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<EGLSetBlobFuncANDROID>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<EGLGetBlobFuncANDROID>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<int16_t>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<const int16_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<char *>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<unsigned char *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const void *const *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<const uint64_t *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
#if defined(ANGLE_PLATFORM_WINDOWS)
template <>
void PackParameter<EGLNativeDisplayType>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
#endif
#if defined(ANGLE_PLATFORM_WINDOWS) || defined(ANGLE_PLATFORM_ANDROID)
template <>
void PackParameter<EGLNativeWindowType>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<EGLNativePixmapType>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
#endif
#if defined(ANGLE_PLATFORM_APPLE) || !defined(ANGLE_IS_64_BIT_CPU)
template <>
void PackParameter<const long *>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
template <>
void PackParameter<long *>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<long>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings);
template <>
void PackParameter<unsigned long>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings);
#endif
template <typename T>
void PackParameter(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings)
{ … }
template <typename T>
struct ParameterPacker;
ParameterPacker<Ret ()>;
ParameterPacker<Ret (Arg)>;
ParameterPacker<Ret (Arg, Args...)>;
ParameterPacker<Ret (*)(Arg, Args...)>;
template <typename Func>
struct RemoveStdCall;
RemoveStdCall<Ret (Args...)>;
template <typename Func>
struct RemoveStdCall
{ … };
template <typename Func>
ParamBuffer ParseParameters(const Token *paramTokens, const TraceStringMap &strings)
{ … }
}
extern "C" {
void SetupReplay();
void ReplayFrame(uint32_t frameIndex);
void ResetReplay();
ANGLE_REPLAY_EXPORT const char *GetSerializedContextState(uint32_t frameIndex);
}
#endif