Commit c3887991 by Tim Van Patten Committed by Commit Bot

Capture/Replay Don't capture invalid commands

Special Forces Group 2 issues invalid OpenGL ES commands, which are currently captured by ANGLE's frame capture. These invalid commands generate errors on both ANGLE and the native driver, causing the test to be marked as "failed". This CL updates FrameCapture::captureCall() to not capture invalid commands, which prevents replay errors. However, the other work related to the call is still performed, including: - maybeOverrideEntryPoint() - maybeCapturePreCallUpdates() - maybeCapturePostCallUpdates() This work is necessary, otherwise calls that update necessary members like FrameCapture::mClientArraySizes may be missed, causing leading to compilation failures related to missing symbols. For example, mClientArraySizes is updated via the following call stack: captureClientArraySnapshot() maybeCaptureDrawArraysClientData() maybeCapturePreCallUpdates() It's necessary for mClientArraySizes to contain non-zero values, so that the variable gClientArrays[] is output by WriteCppReplayIndexFiles(). Otherwise a compilation error will occur when it's referenced by a glVertexAttribPointer() call in the capture. Bug: angleproject:5592 Change-Id: I625a074e035eb75267d8384dc61ce6de1717af91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2673068 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent f6784006
...@@ -699,7 +699,9 @@ size_t MaxClientArraySize(const gl::AttribArray<size_t> &clientArraySizes) ...@@ -699,7 +699,9 @@ size_t MaxClientArraySize(const gl::AttribArray<size_t> &clientArraySizes)
for (size_t size : clientArraySizes) for (size_t size : clientArraySizes)
{ {
if (size > found) if (size > found)
{
found = size; found = size;
}
} }
return found; return found;
...@@ -4344,7 +4346,7 @@ void FrameCapture::maybeCapturePreCallUpdates(const gl::Context *context, CallCa ...@@ -4344,7 +4346,7 @@ void FrameCapture::maybeCapturePreCallUpdates(const gl::Context *context, CallCa
} }
} }
void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call) void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call, bool isCallValid)
{ {
if (SkipCall(call.entryPoint)) if (SkipCall(call.entryPoint))
{ {
...@@ -4355,7 +4357,15 @@ void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call) ...@@ -4355,7 +4357,15 @@ void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call)
maybeCapturePreCallUpdates(context, call); maybeCapturePreCallUpdates(context, call);
mFrameCalls.emplace_back(std::move(call)); if (isCallValid)
{
mFrameCalls.emplace_back(std::move(call));
}
else
{
INFO() << "FrameCapture: Not capturing invalid call to "
<< GetEntryPointName(call.entryPoint);
}
maybeCapturePostCallUpdates(context); maybeCapturePostCallUpdates(context);
} }
......
...@@ -315,7 +315,7 @@ class FrameCapture final : angle::NonCopyable ...@@ -315,7 +315,7 @@ class FrameCapture final : angle::NonCopyable
FrameCapture(); FrameCapture();
~FrameCapture(); ~FrameCapture();
void captureCall(const gl::Context *context, CallCapture &&call); void captureCall(const gl::Context *context, CallCapture &&call, bool isCallValid);
void checkForCaptureTrigger(); void checkForCaptureTrigger();
void onEndFrame(const gl::Context *context); void onEndFrame(const gl::Context *context);
void onDestroyContext(const gl::Context *context); void onDestroyContext(const gl::Context *context);
...@@ -450,12 +450,7 @@ void CaptureCallToFrameCapture(CaptureFuncT captureFunc, ...@@ -450,12 +450,7 @@ void CaptureCallToFrameCapture(CaptureFuncT captureFunc,
CallCapture call = captureFunc(context->getState(), isCallValid, captureParams...); CallCapture call = captureFunc(context->getState(), isCallValid, captureParams...);
if (!isCallValid) frameCapture->captureCall(context, std::move(call), isCallValid);
{
INFO() << "FrameCapture: Capturing invalid call to " << GetEntryPointName(call.entryPoint);
}
frameCapture->captureCall(context, std::move(call));
} }
template <typename T> template <typename T>
......
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