Skip to content

Commit

Permalink
OpenGL2: Fix FB-MSAA on AMD Windows driver
Browse files Browse the repository at this point in the history
Fix r_ext_framebuffer_multisample > 0 causing the screen to always be
solid black when using AMD Windows driver.

The AMD Windows driver requires binding renderbuffer for it to be valid.
The OpenGL2 renderer uses GL_EXT_direct_state_access that shouldn't
require this. It would be required for Core/GL_ARB_direct_state_access.
It seems like a driver bug.
  • Loading branch information
zturtleman committed Nov 20, 2023
1 parent f7c12a1 commit 03bc4eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/renderergl2/tr_fbo.c
Expand Up @@ -170,9 +170,13 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
}

absent = *pRenderBuffer == 0;
if (absent)
if (absent) {
qglGenRenderbuffers(1, pRenderBuffer);

// workaround AMD Windows driver requiring bind to create renderbuffer
GL_BindRenderbuffer(*pRenderBuffer);
}

if (multisample && glRefConfig.framebufferMultisample)
qglNamedRenderbufferStorageMultisampleEXT(*pRenderBuffer, multisample, format, fbo->width, fbo->height);
else
Expand Down

0 comments on commit 03bc4eb

Please sign in to comment.