#include "trace_interpreter.h"
#include "anglebase/no_destructor.h"
#include "common/gl_enum_utils.h"
#include "common/string_utils.h"
#include "trace_fixture.h"
#define USE_SYSTEM_ZLIB
#include "compression_utils_portable.h"
namespace angle
{
namespace
{
bool ShouldParseFile(const std::string &file)
{ … }
void ReplayTraceFunction(const TraceFunction &func, const TraceFunctionMap &customFunctions)
{ … }
class Parser : angle::NonCopyable
{ … };
void PackResourceID(ParamBuffer ¶ms, const Token &token)
{ … }
template <typename IntT>
void PackIntParameter(ParamBuffer ¶ms, ParamType paramType, const Token &token)
{ … }
uint32_t GetStringArrayOffset(const Token &token, const char *prefixString)
{ … }
template <typename PointerT>
void PackMemPointer(ParamBuffer ¶ms, ParamType paramType, uint32_t offset, uint8_t *mem)
{ … }
template <typename T>
void PackMutablePointerParameter(ParamBuffer ¶ms, ParamType paramType, const Token &token)
{ … }
template <typename T>
void PackConstPointerParameter(ParamBuffer ¶ms, ParamType paramType, const Token &token)
{ … }
class TraceInterpreter : angle::NonCopyable
{ … };
void TraceInterpreter::replayFrame(uint32_t frameIndex)
{ … }
void TraceInterpreter::parseTraceUncompressed()
{ … }
void TraceInterpreter::parseTraceGz()
{ … }
void TraceInterpreter::setupReplay()
{ … }
void TraceInterpreter::resetReplay()
{ … }
const char *TraceInterpreter::getSerializedContextState(uint32_t frameIndex)
{ … }
void TraceInterpreter::runTraceFunction(const char *name) const
{ … }
TraceInterpreter &GetInterpreter()
{ … }
}
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)
{
UNREACHABLE();
}
#endif
#if defined(ANGLE_PLATFORM_WINDOWS) || defined(ANGLE_PLATFORM_ANDROID)
template <>
void PackParameter<EGLNativeWindowType>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings)
{
UNREACHABLE();
}
template <>
void PackParameter<EGLNativePixmapType>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings)
{
UNREACHABLE();
}
#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)
{
PackConstPointerParameter<int64_t>(params, ParamType::TGLuint64ConstPointer, token);
}
template <>
void PackParameter<long *>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings)
{
PackMutablePointerParameter<int64_t>(params, ParamType::TGLint64Pointer, token);
}
template <>
void PackParameter<long>(ParamBuffer ¶ms, const Token &token, const TraceStringMap &strings)
{
PackIntParameter<int64_t>(params, ParamType::TGLint64, token);
}
template <>
void PackParameter<unsigned long>(ParamBuffer ¶ms,
const Token &token,
const TraceStringMap &strings)
{
PackIntParameter<uint64_t>(params, ParamType::TGLuint64, token);
}
#endif
GLuint GetResourceIDMapValue(ResourceIDType resourceIDType, GLuint key)
{ … }
}
extern "C" {
void SetupReplay()
{ … }
void ReplayFrame(uint32_t frameIndex)
{ … }
void ResetReplay()
{ … }
const char *GetSerializedContextState(uint32_t frameIndex)
{ … }
}