Commit c0d42fd9 by Lubosz Sarnecki Committed by Commit Bot

TracePerfTest: Delete offscreen objects only when initialized.

Delete Textures, Renderbuffers and Framebuffers that were created in the SurfaceType::Offscreen case, when they were initialized. This caused a crash when replaying traces using GLES 1 contexts on native GLES Android implementations. Bug: angleproject:5932 Change-Id: Ice4bcec620a6c3530044986ce39230b030a901ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2877234Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent a83fe36d
...@@ -1071,14 +1071,18 @@ void TracePerfTest::initializeBenchmark() ...@@ -1071,14 +1071,18 @@ void TracePerfTest::initializeBenchmark()
void TracePerfTest::destroyBenchmark() void TracePerfTest::destroyBenchmark()
{ {
glDeleteTextures(mMaxOffscreenBufferCount, mOffscreenTextures.data()); const auto &params = GetParam();
mOffscreenTextures.fill(0); if (params.surfaceType == SurfaceType::Offscreen)
{
glDeleteTextures(mMaxOffscreenBufferCount, mOffscreenTextures.data());
mOffscreenTextures.fill(0);
glDeleteRenderbuffers(1, &mOffscreenDepthStencil); glDeleteRenderbuffers(1, &mOffscreenDepthStencil);
mOffscreenDepthStencil = 0; mOffscreenDepthStencil = 0;
glDeleteFramebuffers(mMaxOffscreenBufferCount, mOffscreenFramebuffers.data()); glDeleteFramebuffers(mMaxOffscreenBufferCount, mOffscreenFramebuffers.data());
mOffscreenFramebuffers.fill(0); mOffscreenFramebuffers.fill(0);
}
mTraceLibrary->finishReplay(); mTraceLibrary->finishReplay();
mTraceLibrary.reset(nullptr); mTraceLibrary.reset(nullptr);
......
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