diff --git a/src/util/opengl_device.cpp b/src/util/opengl_device.cpp index 1ed2f09ca..18b612c8e 100644 --- a/src/util/opengl_device.cpp +++ b/src/util/opengl_device.cpp @@ -20,7 +20,9 @@ Log_SetChannel(OpenGLDevice); -static constexpr std::array s_clear_color = {{0.0f, 0.0f, 0.0f, 1.0f}}; +static constexpr const std::array s_clear_color = {{0.0f, 0.0f, 0.0f, 1.0f}}; +static constexpr const std::array s_draw_buffers = { + {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3}}; OpenGLDevice::OpenGLDevice() { @@ -633,6 +635,8 @@ GLuint OpenGLDevice::CreateFramebuffer(GPUTexture* const* rts, u32 num_rts, GPUT glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, DS->GetGLTarget(), DS->GetGLId(), 0); } + glDrawBuffers(num_rts, s_draw_buffers.data()); + if (glGetError() != GL_NO_ERROR || glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { Log_ErrorFmt("Failed to create GL framebuffer: {}", static_cast(glGetError()));