Commit 5fb5f63b by Gert Wollny Committed by Angle LUCI CQ

Capture: Write captured context for empty frames

When a frame is empty, still write the captured context for that frame because the index file will contain the frame file, and the replay will execute the according swapbuffer so that the replay will query the context serialization when testing trace correctness. With that enable RobustResourceInitTest.SurfaceInitializedAfterSwap/* for capture/replay. Bug: angleproject:5939 Change-Id: Ib280d55f739cc2bb8d2da0919e98c37a2cd576ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2987991 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 08946bee
...@@ -1122,6 +1122,7 @@ void WriteCppReplay(bool compression, ...@@ -1122,6 +1122,7 @@ void WriteCppReplay(bool compression,
out << "{\n"; out << "{\n";
} }
if (!frameCalls.empty())
{ {
std::stringstream callStream; std::stringstream callStream;
...@@ -4696,13 +4697,18 @@ void FrameCapture::onEndFrame(const gl::Context *context) ...@@ -4696,13 +4697,18 @@ void FrameCapture::onEndFrame(const gl::Context *context)
} }
// Note that we currently capture before the start frame to collect shader and program sources. // Note that we currently capture before the start frame to collect shader and program sources.
if (!mFrameCalls.empty() && isCaptureActive()) if (isCaptureActive())
{ {
if (mIsFirstFrame) if (mIsFirstFrame)
{ {
mCaptureStartFrame = mFrameIndex; mCaptureStartFrame = mFrameIndex;
mIsFirstFrame = false; mIsFirstFrame = false;
} }
if (!mFrameCalls.empty())
{
mActiveFrameIndices.push_back(getReplayFrameIndex());
}
WriteCppReplay(mCompression, mOutDirectory, context, mCaptureLabel, getReplayFrameIndex(), WriteCppReplay(mCompression, mOutDirectory, context, mCaptureLabel, getReplayFrameIndex(),
getFrameCount(), mFrameCalls, mSetupCalls, &mResourceTracker, &mBinaryData, getFrameCount(), mFrameCalls, mSetupCalls, &mResourceTracker, &mBinaryData,
mClientArraySizes, mReadBufferSize, mSerializeStateEnabled); mClientArraySizes, mReadBufferSize, mSerializeStateEnabled);
...@@ -5098,7 +5104,7 @@ void FrameCapture::writeCppReplayIndexFiles(const gl::Context *context, bool wri ...@@ -5098,7 +5104,7 @@ void FrameCapture::writeCppReplayIndexFiles(const gl::Context *context, bool wri
source << "{\n"; source << "{\n";
source << " switch (frameIndex)\n"; source << " switch (frameIndex)\n";
source << " {\n"; source << " {\n";
for (uint32_t frameIndex = 1; frameIndex <= frameCount; ++frameIndex) for (uint32_t frameIndex : mActiveFrameIndices)
{ {
source << " case " << frameIndex << ":\n"; source << " case " << frameIndex << ":\n";
source << " " << FmtReplayFunction(contextId, frameIndex) << ";\n"; source << " " << FmtReplayFunction(contextId, frameIndex) << ";\n";
......
...@@ -434,6 +434,7 @@ class FrameCapture final : angle::NonCopyable ...@@ -434,6 +434,7 @@ class FrameCapture final : angle::NonCopyable
uint32_t mCaptureTrigger; uint32_t mCaptureTrigger;
bool mCaptureActive = false; bool mCaptureActive = false;
std::vector<uint32_t> mActiveFrameIndices;
}; };
// Shared class for any items that need to be tracked by FrameCapture across shared contexts // Shared class for any items that need to be tracked by FrameCapture across shared contexts
......
...@@ -60,7 +60,6 @@ LineLoopTest.DISABLED_DrawArraysWithLargeCount/* ...@@ -60,7 +60,6 @@ LineLoopTest.DISABLED_DrawArraysWithLargeCount/*
MipmapTest.DISABLED_ThreeLevelsInitData/* MipmapTest.DISABLED_ThreeLevelsInitData/*
# Compile failed tests # Compile failed tests
RobustResourceInitTest.SurfaceInitializedAfterSwap/*
# ES1 comparison failed tests # ES1 comparison failed tests
BootAnimationTest.DefaultBootAnimation/* BootAnimationTest.DefaultBootAnimation/*
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