From 6dcaab2d3ad6ee6f12b34622a13dddf28772e840 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Oct 2019 15:18:45 +0200 Subject: [PATCH] glgsg: fix multisample FBO for 16-bit float buffer Fixes #756 --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index d5252944f5..d484a174e4 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1198,7 +1198,11 @@ bind_slot_multisample(bool rb_resize, Texture **attach, RenderTexturePlane slot, if (_fb_properties.get_srgb_color()) { gl_format = GL_SRGB8_ALPHA8; } else if (_fb_properties.get_float_color()) { - gl_format = GL_RGBA32F_ARB; + if (_fb_properties.get_color_bits() > 16 * 3) { + gl_format = GL_RGBA32F_ARB; + } else { + gl_format = GL_RGBA16F_ARB; + } } else { gl_format = GL_RGBA; }