Commit 609d45f6 by Jamie Madill Committed by Commit Bot

Capture/Replay: Use Renderbuffer ID map.

This should give a more robust replay. Devices are not guaranteed to return IDs in the same order in each instance of a program. Also for mid-execution capture we often won't have the same resources available. Once the Renderbuffer implementation lands we can switch to using more resource maps for different types of resources. Bug: angleproject:3611 Change-Id: I84a5b84856be3e8eb13e424e1990a39553adb82e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1719066Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent cc25d9fb
...@@ -61,6 +61,8 @@ class ParamBuffer final : angle::NonCopyable ...@@ -61,6 +61,8 @@ class ParamBuffer final : angle::NonCopyable
T paramValue); T paramValue);
ParamCapture &getParam(const char *paramName, ParamType paramType, int index); ParamCapture &getParam(const char *paramName, ParamType paramType, int index);
const ParamCapture &getParam(const char *paramName, ParamType paramType, int index) const;
const ParamCapture &getReturnValue() const { return mReturnValueCapture; }
void addParam(ParamCapture &&param); void addParam(ParamCapture &&param);
void addReturnValue(ParamCapture &&returnValue); void addReturnValue(ParamCapture &&returnValue);
...@@ -119,6 +121,21 @@ class FrameCapture final : angle::NonCopyable ...@@ -119,6 +121,21 @@ class FrameCapture final : angle::NonCopyable
int getAndIncrementCounter(gl::EntryPoint entryPoint, const std::string &paramName); int getAndIncrementCounter(gl::EntryPoint entryPoint, const std::string &paramName);
bool anyClientArray() const; bool anyClientArray() const;
void saveCapturedFrameAsCpp(); void saveCapturedFrameAsCpp();
void writeStringPointerParamReplay(std::ostream &out,
std::ostream &header,
const CallCapture &call,
const ParamCapture &param);
void writeRenderbufferIDPointerParamReplay(std::ostream &out,
std::ostream &header,
const CallCapture &call,
const ParamCapture &param);
void writeBinaryParamReplay(std::ostream &out,
std::ostream &header,
const CallCapture &call,
const ParamCapture &param,
std::vector<uint8_t> *binaryData);
void maybeCaptureClientData(const gl::Context *context, const CallCapture &call);
void maybeUpdateResourceIDs(const gl::Context *context, const CallCapture &call);
std::vector<CallCapture> mCalls; std::vector<CallCapture> mCalls;
gl::AttribArray<int> mClientVertexArrayMap; gl::AttribArray<int> mClientVertexArrayMap;
......
...@@ -109,7 +109,7 @@ void CaptureDeleteFramebuffers_framebuffers(const Context *context, ...@@ -109,7 +109,7 @@ void CaptureDeleteFramebuffers_framebuffers(const Context *context,
const GLuint *framebuffers, const GLuint *framebuffers,
ParamCapture *paramCapture) ParamCapture *paramCapture)
{ {
UNIMPLEMENTED(); CaptureMemory(framebuffers, sizeof(GLuint) * n, paramCapture);
} }
void CaptureDeleteRenderbuffers_renderbuffersPacked(const Context *context, void CaptureDeleteRenderbuffers_renderbuffersPacked(const Context *context,
...@@ -118,7 +118,7 @@ void CaptureDeleteRenderbuffers_renderbuffersPacked(const Context *context, ...@@ -118,7 +118,7 @@ void CaptureDeleteRenderbuffers_renderbuffersPacked(const Context *context,
const RenderbufferID *renderbuffers, const RenderbufferID *renderbuffers,
ParamCapture *paramCapture) ParamCapture *paramCapture)
{ {
UNIMPLEMENTED(); CaptureMemory(renderbuffers, sizeof(RenderbufferID) * n, paramCapture);
} }
void CaptureDeleteTextures_texturesPacked(const Context *context, void CaptureDeleteTextures_texturesPacked(const Context *context,
...@@ -175,6 +175,7 @@ void CaptureGenRenderbuffers_renderbuffersPacked(const Context *context, ...@@ -175,6 +175,7 @@ void CaptureGenRenderbuffers_renderbuffersPacked(const Context *context,
ParamCapture *paramCapture) ParamCapture *paramCapture)
{ {
paramCapture->readBufferSizeBytes = sizeof(RenderbufferID) * n; paramCapture->readBufferSizeBytes = sizeof(RenderbufferID) * n;
CaptureMemory(renderbuffers, paramCapture->readBufferSizeBytes, paramCapture);
} }
void CaptureGenTextures_texturesPacked(const Context *context, void CaptureGenTextures_texturesPacked(const Context *context,
......
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