From ee72f7d07f26b5575f90636d242e6af2d569dddf Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Sun, 8 Jun 2025 22:23:12 +0800 Subject: [PATCH] [Fix] (Diligent/Framebuffer): Make sure glBlitFramebuffer is not in renderpass. --- MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp b/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp index 81273b41..cd3d2fc4 100644 --- a/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp +++ b/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp @@ -490,6 +490,13 @@ namespace MG_GL::GL { void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { + if (MG_Diligent::IsInRenderPass) { + MG_Util::Debug::LogD("Ending current render pass."); + MG_Diligent::g_pContext->EndRenderPass(); + MG_Diligent::IsInRenderPass = false; + MG_Util::Debug::LogD("Current render pass ended."); + } + GLuint readFB = MG_State_T::framebufferState->currentBindings_[GL_READ_FRAMEBUFFER]; GLuint drawFB = MG_State_T::framebufferState->currentBindings_[GL_DRAW_FRAMEBUFFER];