From 98f2a552145534e5e8c8dae63e69f0e515ce1e19 Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Tue, 18 Aug 2026 13:38:44 +0800 Subject: [PATCH] [Feat] (Diligent, MG_Impl): clear depth in GL Clear when GL_DEPTH_BUFFER_BIT set --- MobileGL/MG_Backend/Diligent/BackendObject_Diligent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MobileGL/MG_Backend/Diligent/BackendObject_Diligent.cpp b/MobileGL/MG_Backend/Diligent/BackendObject_Diligent.cpp index 1e629ed7..4f52cc58 100644 --- a/MobileGL/MG_Backend/Diligent/BackendObject_Diligent.cpp +++ b/MobileGL/MG_Backend/Diligent/BackendObject_Diligent.cpp @@ -44,6 +44,9 @@ namespace MobileGL::MG_Backend::DiligentBackend { const auto& color = MG_State::pGLContext->GetClearColor(); renderer->Clear(color.x(), color.y(), color.z(), color.w()); } + if ((mask & GL_DEPTH_BUFFER_BIT) != 0) { + renderer->ClearDepth(MG_State::pGLContext->GetClearDepth()); + } } void DrawArrays(GLenum mode, GLint first, GLsizei count) {