From 5912467f062285c5b178f6752a30c7ef1b73d6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Mar 2019 23:11:36 +0100 Subject: [PATCH] GL: follow ES restrictions in multi-attachment framebuffer tests. --- src/Magnum/GL/Test/FramebufferGLTest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index 6b6f3ddd6..c8bdb2761 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -1051,12 +1051,15 @@ void FramebufferGLTest::multipleColorOutputs() { Renderbuffer depth; depth.setStorage(RenderbufferFormat::DepthComponent16, Vector2i(128)); + /* According to EXT_draw_buffers, the th value in has to be + either COLOR_ATTACHMENT_EXT or NONE, so watch out -- list them in + order. */ Framebuffer framebuffer({{}, Vector2i(128)}); - framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color1, 0) - .attachTexture(Framebuffer::ColorAttachment(1), color2, 0) + framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color2, 0) + .attachTexture(Framebuffer::ColorAttachment(1), color1, 0) .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depth) - .mapForDraw({{0, Framebuffer::ColorAttachment(1)}, - {1, Framebuffer::ColorAttachment(0)}, + .mapForDraw({{0, Framebuffer::ColorAttachment(0)}, + {1, Framebuffer::ColorAttachment(1)}, {2, Framebuffer::DrawAttachment::None}}); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))