From 76a4f4ab2f73029b4c065666e6cc0fb8ce95ea9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Aug 2014 12:37:58 +0200 Subject: [PATCH] Neither multisample nor rectangle textures have mip levels. Removed superfluous level parameter from related Framebuffer::attachTexture{,Layer}() overloads (which should otherwise be always set to 0). --- src/Magnum/Framebuffer.cpp | 12 ++++++------ src/Magnum/Framebuffer.h | 6 +++--- src/Magnum/Test/FramebufferGLTest.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index dde39e676..3ae6ba369 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -186,13 +186,13 @@ Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Textu } #ifndef MAGNUM_TARGET_GLES -Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, RectangleTexture& texture, const Int level) { - (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), level); +Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, RectangleTexture& texture) { + (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), 0); return *this; } -Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, MultisampleTexture2D& texture, const Int level) { - (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), level); +Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, MultisampleTexture2D& texture) { + (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), 0); return *this; } #endif @@ -227,8 +227,8 @@ Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attac return *this; } -Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attachment, MultisampleTexture2DArray& texture, Int level, Int layer) { - (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); +Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attachment, MultisampleTexture2DArray& texture, Int layer) { + (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), 0, layer); return *this; } #endif diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index 7d055b16f..9741d1a88 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -522,13 +522,13 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * @requires_gl31 %Extension @extension{ARB,texture_rectangle} * @requires_gl Rectangle textures are not available in OpenGL ES. */ - Framebuffer& attachTexture(BufferAttachment attachment, RectangleTexture& texture, Int level); + Framebuffer& attachTexture(BufferAttachment attachment, RectangleTexture& texture); /** @overload * @requires_gl32 %Extension @extension{ARB,texture_multisample} * @requires_gl Multisample textures are not available in OpenGL ES. */ - Framebuffer& attachTexture(BufferAttachment attachment, MultisampleTexture2D& texture, Int level); + Framebuffer& attachTexture(BufferAttachment attachment, MultisampleTexture2D& texture); #endif /** @@ -594,7 +594,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * @requires_gl32 %Extension @extension{ARB,texture_multisample} * @requires_gl Multisample textures are not available in OpenGL ES. */ - Framebuffer& attachTextureLayer(BufferAttachment attachment, MultisampleTexture2DArray& texture, Int level, Int layer); + Framebuffer& attachTextureLayer(BufferAttachment attachment, MultisampleTexture2DArray& texture, Int layer); #endif #ifdef MAGNUM_BUILD_DEPRECATED diff --git a/src/Magnum/Test/FramebufferGLTest.cpp b/src/Magnum/Test/FramebufferGLTest.cpp index ca2e88f42..efebc4852 100644 --- a/src/Magnum/Test/FramebufferGLTest.cpp +++ b/src/Magnum/Test/FramebufferGLTest.cpp @@ -486,8 +486,8 @@ void FramebufferGLTest::attachRectangleTexture() { depthStencil.setStorage(TextureFormat::Depth24Stencil8, Vector2i(128)); Framebuffer framebuffer({{}, Vector2i(128)}); - framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color, 0) - .attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); + framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color) + .attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete);