Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a9b199b

Browse files
cnorthropCommit Bot
authored andcommitted
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/+/2355705 Reviewed-by: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
1 parent 9ae6d7f commit a9b199b

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/libANGLE/FrameCapture.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3680,6 +3680,29 @@ void FrameCapture::trackBufferMapping(CallCapture *call,
36803680
}
36813681
}
36823682

3683+
void FrameCapture::maybeOverrideEntryPoint(const gl::Context *context, CallCapture &call)
3684+
{
3685+
switch (call.entryPoint)
3686+
{
3687+
case gl::EntryPoint::EGLImageTargetTexture2DOES:
3688+
{
3689+
// We don't support reading EGLImages. Instead, just pull from a tiny null texture.
3690+
// TODO (anglebug.com/4964): Read back the image data and populate the texture.
3691+
std::vector<uint8_t> pixelData = {0, 0, 0, 0};
3692+
call = CaptureTexSubImage2D(context->getState(), true, gl::TextureTarget::_2D, 0, 0, 0,
3693+
1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixelData.data());
3694+
break;
3695+
}
3696+
case gl::EntryPoint::EGLImageTargetRenderbufferStorageOES:
3697+
{
3698+
UNIMPLEMENTED();
3699+
break;
3700+
}
3701+
default:
3702+
break;
3703+
}
3704+
}
3705+
36833706
void FrameCapture::maybeCaptureClientData(const gl::Context *context, CallCapture &call)
36843707
{
36853708
switch (call.entryPoint)
@@ -3948,6 +3971,8 @@ void FrameCapture::maybeCaptureClientData(const gl::Context *context, CallCaptur
39483971

39493972
void FrameCapture::captureCall(const gl::Context *context, CallCapture &&call)
39503973
{
3974+
maybeOverrideEntryPoint(context, call);
3975+
39513976
// Process client data snapshots.
39523977
maybeCaptureClientData(context, call);
39533978

src/libANGLE/FrameCapture.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ class FrameCapture final : angle::NonCopyable
328328
void captureCompressedTextureData(const gl::Context *context, const CallCapture &call);
329329

330330
void reset();
331+
void maybeOverrideEntryPoint(const gl::Context *context, CallCapture &call);
331332
void maybeCaptureClientData(const gl::Context *context, CallCapture &call);
332333
void maybeCapturePostCallUpdates(const gl::Context *context);
333334

0 commit comments

Comments
 (0)