Commit a798819c by Cody Northrop Committed by Commit Bot

Capture/Replay: Dedup shaders to reduce capture size

This CL will track whether a string has already been declared and written in the output file. This cuts the shader string count in NBA2K20 trace by 85%, eliminating about 300K lines of code from setup. Test: Compile and link NBA2K20 trace for Android Bug: b/160014453 Bug: angleproject:4048 Change-Id: Id854b3314644c1e4aae41cd6bb4157f92e9b1945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2339852Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 063d754b
......@@ -23,6 +23,8 @@ enum class GLenumGroup;
namespace angle
{
using ParamData = std::vector<std::vector<uint8_t>>;
struct ParamCapture : angle::NonCopyable
{
ParamCapture();
......@@ -36,7 +38,7 @@ struct ParamCapture : angle::NonCopyable
ParamType type;
ParamValue value;
gl::GLenumGroup enumGroup; // only used for param type GLenum, GLboolean and GLbitfield
std::vector<std::vector<uint8_t>> data;
ParamData data;
int arrayClientPointerIndex = -1;
size_t readBufferSizeBytes = 0;
};
......@@ -177,6 +179,34 @@ class DataCounters final : angle::NonCopyable
std::map<Counter, int> mData;
};
constexpr int kStringNotFound = -1;
class StringCounters final : angle::NonCopyable
{
public:
StringCounters();
~StringCounters();
int getStringCounter(std::string &str);
void setStringCounter(std::string &str, int &counter);
private:
std::map<std::string, int> mStringCounterMap;
};
class DataTracker final : angle::NonCopyable
{
public:
DataTracker();
~DataTracker();
DataCounters &getCounters() { return mCounters; }
StringCounters &getStringCounters() { return mStringCounters; }
private:
DataCounters mCounters;
StringCounters mStringCounters;
};
using BufferSet = std::set<gl::BufferID>;
using BufferCalls = std::map<gl::BufferID, std::vector<CallCapture>>;
......
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