Fix a GL error when taking a screenshot in non-buffered. May help #11056

This commit is contained in:
Henrik Rydgård committed 2018-06-01 22:25:27 +02:00
1 parent 04fefa2417
commit 8d3dbee823
1 file changed
+2 -2
+2 -2
View File
@@ -1079,8 +1079,8 @@ void GLQueueRunner::PerformReadback(const GLRStep &pass) {
fbo_bind_fb_target(true, fb ? fb->handle : 0);
// Reads from the "bound for read" framebuffer.
if (gl_extensions.GLES3 || !gl_extensions.IsGLES)
// Reads from the "bound for read" framebuffer. Note that if there's no fb, it's not valid to call this.
if (fb && (gl_extensions.GLES3 || !gl_extensions.IsGLES))
glReadBuffer(GL_COLOR_ATTACHMENT0);
CHECK_GL_ERROR_IF_DEBUG();