Commit 06f4f3e1 by Cody Northrop Committed by Commit Bot

Capture/Replay: Disable binary formats when FrameCapture is enabled

Rather than capture and replay a format that is not cross platform, limit the number of exposed binary formats to zero when FrameCapture is enabled. Test: Temple Run capture and replay Bug: b:152512564 Bug: angleproject:3662 Change-Id: I4a7bc5a353d2cdb1dceb1276a3c61bfbb74dc2f7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2128327 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent db32bda4
...@@ -3183,6 +3183,16 @@ void Context::initCaps() ...@@ -3183,6 +3183,16 @@ void Context::initCaps()
mState.mCaps.maxSmoothLineWidth = 1.0f; mState.mCaps.maxSmoothLineWidth = 1.0f;
} }
// If we're capturing application calls for replay, don't expose any binary formats to prevent
// traces from trying to use cached results
if (getFrameCapture()->enabled())
{
INFO() << "Limiting binary format support count to zero while FrameCapture enabled"
<< std::endl;
mState.mCaps.shaderBinaryFormats.clear();
mState.mCaps.programBinaryFormats.clear();
}
#if 0 #if 0
// This logging can generate a lot of spam in test suites that create many contexts // This logging can generate a lot of spam in test suites that create many contexts
# define ANGLE_LOG_LIMITED_CAP(cap, limit) \ # define ANGLE_LOG_LIMITED_CAP(cap, limit) \
......
...@@ -3252,7 +3252,7 @@ int DataCounters::getAndIncrement(gl::EntryPoint entryPoint, const std::string & ...@@ -3252,7 +3252,7 @@ int DataCounters::getAndIncrement(gl::EntryPoint entryPoint, const std::string &
return mData[counterKey]++; return mData[counterKey]++;
} }
bool FrameCapture::enabled() const bool FrameCapture::isCapturing() const
{ {
// Currently we will always do a capture up until the last frame. In the future we could improve // Currently we will always do a capture up until the last frame. In the future we could improve
// mid execution capture by only capturing between the start and end frames. The only necessary // mid execution capture by only capturing between the start and end frames. The only necessary
......
...@@ -195,7 +195,9 @@ class FrameCapture final : angle::NonCopyable ...@@ -195,7 +195,9 @@ class FrameCapture final : angle::NonCopyable
void captureCall(const gl::Context *context, CallCapture &&call); void captureCall(const gl::Context *context, CallCapture &&call);
void onEndFrame(const gl::Context *context); void onEndFrame(const gl::Context *context);
bool enabled() const; bool enabled() const { return mEnabled; }
bool isCapturing() const;
void replay(gl::Context *context); void replay(gl::Context *context);
private: private:
...@@ -222,7 +224,7 @@ class FrameCapture final : angle::NonCopyable ...@@ -222,7 +224,7 @@ class FrameCapture final : angle::NonCopyable
// This simplifies a lot of file management. // This simplifies a lot of file management.
std::vector<uint8_t> mBinaryData; std::vector<uint8_t> mBinaryData;
bool mEnabled; bool mEnabled = false;
std::string mOutDirectory; std::string mOutDirectory;
std::string mCaptureLabel; std::string mCaptureLabel;
bool mCompression; bool mCompression;
...@@ -251,7 +253,7 @@ void CaptureCallToFrameCapture(CaptureFuncT captureFunc, ...@@ -251,7 +253,7 @@ void CaptureCallToFrameCapture(CaptureFuncT captureFunc,
ArgsT... captureParams) ArgsT... captureParams)
{ {
FrameCapture *frameCapture = context->getFrameCapture(); FrameCapture *frameCapture = context->getFrameCapture();
if (!frameCapture->enabled()) if (!frameCapture->isCapturing())
return; return;
CallCapture call = captureFunc(context->getState(), isCallValid, captureParams...); CallCapture call = captureFunc(context->getState(), isCallValid, captureParams...);
......
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