Commit 580f40a6 by Jamie Madill Committed by Commit Bot

Capture/Replay: Embed ANGLE version in replay.

This is embedded as a #define. It can be used for book-keeping and can also be used to control integration when there's incompatibility. Bug: angleproject:5135 Change-Id: Ie0bb8ff9509c5f973860cb9e6ae48714a27c7398 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2449163 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent bc2dd313
......@@ -208,12 +208,20 @@ bool EndsWith(const char *str, const char *suffix)
void ToLower(std::string *str)
{
for (auto &ch : *str)
for (char &ch : *str)
{
ch = static_cast<char>(::tolower(ch));
}
}
void ToUpper(std::string *str)
{
for (char &ch : *str)
{
ch = static_cast<char>(::toupper(ch));
}
}
bool ReplaceSubstring(std::string *str,
const std::string &substring,
const std::string &replacement)
......
......@@ -85,6 +85,9 @@ bool EndsWith(const char *str, const char *suffix);
// Convert to lower-case.
void ToLower(std::string *str);
// Convert to upper-case.
void ToUpper(std::string *str);
// Replaces the substring 'substring' in 'str' with 'replacement'. Returns true if successful.
bool ReplaceSubstring(std::string *str,
const std::string &substring,
......
......@@ -19,6 +19,7 @@
#include "common/mathutil.h"
#include "common/string_utils.h"
#include "common/system_utils.h"
#include "common/version.h"
#include "libANGLE/Config.h"
#include "libANGLE/Context.h"
#include "libANGLE/Display.h"
......@@ -1203,6 +1204,16 @@ void WriteCppReplayIndexFiles(bool compression,
header << "#pragma once\n";
header << "\n";
header << "// Version of ANGLE used to capture this replay.\n";
header << "#define ANGLE_REPLAY_VERSION";
if (!captureLabel.empty())
{
std::string captureLabelUpper = captureLabel;
angle::ToUpper(&captureLabelUpper);
header << "_" << captureLabelUpper;
}
header << " " << ANGLE_REVISION << "\n";
header << "\n";
header << "#include <EGL/egl.h>\n";
header << "#include \"angle_gl.h\"\n";
header << "\n";
......
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