From 52c0e2759edffa0edcc467f58be0b8715922abdb Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 16 Mar 2021 18:45:27 +0100 Subject: [PATCH] glgsg: Fix copy-to-texture/ram for multisample FBO Should read from resolved FBO, not from multisample FBO Fixes #1129 --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 7413fef56e..ff28f4c192 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1937,6 +1937,9 @@ resolve_multisamples() { #endif report_my_gl_errors(); + // Bind the regular FBO as read buffer for the sake of copy_to_textures. + glgsg->_glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, fbo); + #ifndef OPENGLES if (_have_any_color) { glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);