ngl: fbo 0 has no color attachment

Query the backbuffer instead.
This commit is contained in:
Benjamin Otte 2021-10-08 02:28:49 +02:00
parent 222d927e93
commit 4f53645e5d

View File

@ -4071,7 +4071,10 @@ get_framebuffer_format (guint framebuffer)
int size;
glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
glGetFramebufferAttachmentParameteriv (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &size);
glGetFramebufferAttachmentParameteriv (GL_FRAMEBUFFER,
framebuffer ? GL_COLOR_ATTACHMENT0
: GL_BACK,
GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &size);
if (size >= 32)
return GL_RGBA32F;