Skip to content

Commit e7b3fe2

Browse files
null77Commit Bot
authored andcommitted
Context: Release surface first in onDestroy.
This works around a bug in Vulkan where the VertexArrayVk still had resources in use when the Context was being destroyed. An alternative approach is to call finish() from Context::onDestroy, but this seems heavyweight. We might have to adopt something like this eventually though. Bug: angleproject:2389 Change-Id: Id99ca00404972a0b857c0e7e36f37b8ac4fd5c5e Reviewed-on: https://chromium-review.googlesource.com/997743 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
1 parent f9176ce commit e7b3fe2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libANGLE/Context.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,11 @@ Context::Context(rx::EGLImplFactory *implFactory,
432432

433433
egl::Error Context::onDestroy(const egl::Display *display)
434434
{
435+
// Delete the Surface first to trigger a finish() in Vulkan.
436+
SafeDelete(mSurfacelessFramebuffer);
437+
438+
ANGLE_TRY(releaseSurface(display));
439+
435440
for (auto fence : mFenceNVMap)
436441
{
437442
SafeDelete(fence.second);
@@ -474,9 +479,6 @@ egl::Error Context::onDestroy(const egl::Display *display)
474479
}
475480
}
476481

477-
SafeDelete(mSurfacelessFramebuffer);
478-
479-
ANGLE_TRY(releaseSurface(display));
480482
releaseShaderCompiler();
481483

482484
mGLState.reset(this);

0 commit comments

Comments
 (0)