Commit 54e99d36b70fd310c7f899faddf937158f2459a1

Tim Van Patten 2021-04-23T13:02:43

Vulkan: Cleanup garbage when destroying EGL images SurfaceFlinger will optimistically create EGL images just in case it does need them in the future, since creating them can be slow and waiting until they're necessary can cause jank on 90hz+ devices. However, since the images are never actually used, ANGLE's garbage is never cleaned up so vkDestroyImage() and the memory is never freed. This can lead to exhausting the device's memory when many EGL images are allocated. For example, when running the CTS test CtsBiometricsTestCases. This CL adds a call to always cleanup the renderer's garbage when an EGL image is destroyed via eglDestroyImageKHR(), since we can't know if a draw will ever be performed in the future (which would normally cleanup the garbage). Bug: b/184388756 Test: atest CtsBiometricsTestCases Change-Id: I104c05c7be44f1e57123ac7eed23effaa982837a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2848131 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jason Macnak <natsu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>