Commit a9b199b0 by Cody Northrop Committed by Commit Bot

Capture/Replay: Add ability to override entry points

We don't support populating a texture from an EGLImage, but this feature is in use by games. Instead, populate the texture with null data. In the future, improve this by reading back the data. Test: Capture and play back first 1200 frames of COD. Bug: b/164426913 Bug: angleproject:4048 Change-Id: Ic8c6bdf3c359c89e647c28b8c57b7218bdf05b15 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2355705Reviewed-by: 's avatarManh Nguyen <nguyenmh@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 9ae6d7f2
...@@ -3680,6 +3680,29 @@ void FrameCapture::trackBufferMapping(CallCapture *call, ...@@ -3680,6 +3680,29 @@ void FrameCapture::trackBufferMapping(CallCapture *call,
} }
} }
void FrameCapture::maybeOverrideEntryPoint(const gl::Context *context, CallCapture &call)
{
switch (call.entryPoint)
{
case gl::EntryPoint::EGLImageTargetTexture2DOES:
{
// We don't support reading EGLImages. Instead, just pull from a tiny null texture.
// TODO (anglebug.com/4964): Read back the image data and populate the texture.
std::vector<uint8_t> pixelData = {0, 0, 0, 0};
call = CaptureTexSubImage2D(context->getState(), true, gl::TextureTarget::_2D, 0, 0, 0,
1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixelData.data());
break;
}
case gl::EntryPoint::EGLImageTargetRenderbufferStorageOES:
{
UNIMPLEMENTED();
break;
}
default:
break;
}
}
void FrameCapture::maybeCaptureClientData(const gl::Context *context, CallCapture &call) void FrameCapture::maybeCaptureClientData(const gl::Context *context, CallCapture &call)
{ {
switch (call.entryPoint) switch (call.entryPoint)
...@@ -3948,6 +3971,8 @@ void FrameCapture::maybeCaptureClientData(const gl::Context *context, CallCaptur ...@@ -3948,6 +3971,8 @@ void FrameCapture::maybeCaptureClientData(const gl::Context *context, CallCaptur
void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call) void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call)
{ {
maybeOverrideEntryPoint(context, call);
// Process client data snapshots. // Process client data snapshots.
maybeCaptureClientData(context, call); maybeCaptureClientData(context, call);
......
...@@ -328,6 +328,7 @@ class FrameCapture final : angle::NonCopyable ...@@ -328,6 +328,7 @@ class FrameCapture final : angle::NonCopyable
void captureCompressedTextureData(const gl::Context *context, const CallCapture &call); void captureCompressedTextureData(const gl::Context *context, const CallCapture &call);
void reset(); void reset();
void maybeOverrideEntryPoint(const gl::Context *context, CallCapture &call);
void maybeCaptureClientData(const gl::Context *context, CallCapture &call); void maybeCaptureClientData(const gl::Context *context, CallCapture &call);
void maybeCapturePostCallUpdates(const gl::Context *context); void maybeCapturePostCallUpdates(const gl::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