Capture/Replay: Add texture buffer support

Test: Fortnite MEC
Bug: b/180418810
Bug: angleproject:5658
Change-Id: I2025f0b88f7488a827159029e6d04a4cf4e9a1b8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2611558
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This commit is contained in:
Cody Northrop 2021-01-05 16:58:50 -07:00 коммит произвёл Commit Bot
Родитель 7ae8531bd7
Коммит 51c5137a82
1 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@ -33,6 +33,8 @@
#include "libANGLE/capture/capture_gles_2_0_autogen.h"
#include "libANGLE/capture/capture_gles_3_0_autogen.h"
#include "libANGLE/capture/capture_gles_3_1_autogen.h"
#include "libANGLE/capture/capture_gles_3_2_autogen.h"
#include "libANGLE/capture/capture_gles_ext_autogen.h"
#include "libANGLE/capture/frame_capture_utils.h"
#include "libANGLE/capture/gl_enum_utils.h"
#include "libANGLE/queryconversions.h"
@ -2125,6 +2127,11 @@ void CaptureTextureStorage(std::vector<CallCapture> *setupCalls,
desc.size.width, desc.size.height, desc.size.depth));
break;
}
case gl::TextureType::Buffer:
{
// Do nothing. This will already be captured as a buffer.
break;
}
default:
UNIMPLEMENTED();
break;
@ -2141,6 +2148,28 @@ void CaptureTextureContents(std::vector<CallCapture> *setupCalls,
{
const gl::InternalFormat &format = *desc.format.info;
if (index.getType() == gl::TextureType::Buffer)
{
// Zero binding size indicates full buffer bound
if (texture->getBuffer().getSize() == 0)
{
Capture(setupCalls,
CaptureTexBufferEXT(*replayState, true, index.getType(), format.internalFormat,
texture->getBuffer().get()->id()));
}
else
{
Capture(setupCalls, CaptureTexBufferRangeEXT(*replayState, true, index.getType(),
format.internalFormat,
texture->getBuffer().get()->id(),
texture->getBuffer().getOffset(),
texture->getBuffer().getSize()));
}
// For buffers, we're done
return;
}
bool is3D =
(index.getType() == gl::TextureType::_3D || index.getType() == gl::TextureType::_2DArray);
@ -2649,8 +2678,18 @@ void CaptureMidExecutionSetup(const gl::Context *context,
ASSERT(index.getType() == gl::TextureType::_2D ||
index.getType() == gl::TextureType::_3D ||
index.getType() == gl::TextureType::_2DArray ||
index.getType() == gl::TextureType::Buffer ||
index.getType() == gl::TextureType::CubeMap);
if (index.getType() == gl::TextureType::Buffer)
{
// The buffer contents are already backed up, but we need to emit the TexBuffer
// binding calls
CaptureTextureContents(setupCalls, &replayState, texture, index, desc, 0, 0);
continue;
}
if (format.compressed)
{
// For compressed images, we've tracked a copy of the incoming data, so we can