Commit dba2e136 by Gert Wollny Committed by Angle LUCI CQ

Capture/Replay: Emit InitializeReplay() late

Only emit InitializeReplay() after all captured frames have been run, so that the readBufferSize and the maxClientArraySize are really sufficiently large for all frames. To achieve this a layer of indirection is added, that is because InitializeReplay() has to be called from SetupFrame() which is still emitted with the first frame, a new function InitReplay() is added. The call to this function is emitted with the first frame, buts its body is emitted after the last frame has been captured. Bug: angleproject:5965 Change-Id: Ic38791b4c02989594ec87d1ba3f031fd81471314 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2940841Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 824e56f2
...@@ -1077,11 +1077,8 @@ void WriteCppReplay(bool compression, ...@@ -1077,11 +1077,8 @@ void WriteCppReplay(bool compression,
setupCallStream << "void " << FmtSetupFunction(kNoPartId) << "\n"; setupCallStream << "void " << FmtSetupFunction(kNoPartId) << "\n";
setupCallStream << "{\n"; setupCallStream << "{\n";
setupCallStream << " " << captureLabel << "::InitReplay();\n";
size_t maxClientArraySize = MaxClientArraySize(clientArraySizes);
WriteInitReplayCall(compression, setupCallStream, context->id(), captureLabel,
maxClientArraySize, readBufferSize);
WriteCppReplayFunctionWithParts(context, ReplayFunc::Setup, &dataTracker, frameIndex, WriteCppReplayFunctionWithParts(context, ReplayFunc::Setup, &dataTracker, frameIndex,
binaryData, setupCalls, header, setupCallStream, out); binaryData, setupCalls, header, setupCallStream, out);
...@@ -5070,6 +5067,8 @@ void FrameCapture::writeCppReplayIndexFiles(const gl::Context *context, bool wri ...@@ -5070,6 +5067,8 @@ void FrameCapture::writeCppReplayIndexFiles(const gl::Context *context, bool wri
header << "\n"; header << "\n";
} }
header << "void InitReplay();\n";
source << "#include \"" << FmtCapturePrefix(contextId, mCaptureLabel) << ".h\"\n"; source << "#include \"" << FmtCapturePrefix(contextId, mCaptureLabel) << ".h\"\n";
source << "#include \"trace_fixture.h\"\n"; source << "#include \"trace_fixture.h\"\n";
source << "\n"; source << "\n";
...@@ -5080,6 +5079,12 @@ void FrameCapture::writeCppReplayIndexFiles(const gl::Context *context, bool wri ...@@ -5080,6 +5079,12 @@ void FrameCapture::writeCppReplayIndexFiles(const gl::Context *context, bool wri
source << "\n"; source << "\n";
} }
source << "void " << mCaptureLabel << "::InitReplay()\n";
source << "{\n";
WriteInitReplayCall(mCompression, source, context->id(), mCaptureLabel,
MaxClientArraySize(mClientArraySizes), mReadBufferSize);
source << "}\n";
source << "extern \"C\" {\n"; source << "extern \"C\" {\n";
source << "void ReplayFrame(uint32_t frameIndex)\n"; source << "void ReplayFrame(uint32_t frameIndex)\n";
source << "{\n"; source << "{\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