[Feat] (Diligent, EGL): release swap chain on EGL surface release

This commit is contained in:
BZLZHH
2026-08-23 10:55:40 +08:00
parent b045024b6c
commit 525607bad6
2 changed files with 8 additions and 0 deletions
@@ -841,6 +841,13 @@ namespace MobileGL::MG_Backend::DiligentBackend {
BackendObject::ReleaseEGLResources();
}
void BackendObject_Diligent::OnEGLSurfaceReleased(EGLSurface surface) {
(void)surface;
if (m_pRenderer != nullptr) {
m_pRenderer->ReleaseSwapChain();
}
}
Bool BackendObject_Diligent::ResizeEGLWindowSurface(EGLSurface surface, Uint32 width, Uint32 height) {
const std::lock_guard<std::recursive_mutex> lock(m_eglStateMutex);
if (!BackendObject::ResizeEGLWindowSurface(surface, width, height)) {
@@ -44,6 +44,7 @@ namespace MobileGL::MG_Backend::DiligentBackend {
Bool InitWindowSurface() override;
Bool InitPbufferSurface(EGLint width, EGLint height) override;
Bool ResizeEGLWindowSurface(EGLSurface surface, Uint32 width, Uint32 height) override;
void OnEGLSurfaceReleased(EGLSurface surface) override;
const RendererInfo& GetRendererInfo() const override;
String GetBackendAPIVersionString() const override;