Browse Source

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).
pull/68/head
Vladimír Vondruš 12 years ago
parent
commit
76a4f4ab2f
  1. 12
      src/Magnum/Framebuffer.cpp
  2. 6
      src/Magnum/Framebuffer.h
  3. 4
      src/Magnum/Test/FramebufferGLTest.cpp

12
src/Magnum/Framebuffer.cpp

@ -186,13 +186,13 @@ Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Textu
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, RectangleTexture& texture, const Int level) { Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, RectangleTexture& texture) {
(this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), level); (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), 0);
return *this; return *this;
} }
Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, MultisampleTexture2D& texture, const Int level) { Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, MultisampleTexture2D& texture) {
(this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), level); (this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), 0);
return *this; return *this;
} }
#endif #endif
@ -227,8 +227,8 @@ Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attac
return *this; return *this;
} }
Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attachment, MultisampleTexture2DArray& texture, Int level, Int layer) { Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attachment, MultisampleTexture2DArray& texture, Int layer) {
(this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer); (this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), 0, layer);
return *this; return *this;
} }
#endif #endif

6
src/Magnum/Framebuffer.h

@ -522,13 +522,13 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @requires_gl31 %Extension @extension{ARB,texture_rectangle} * @requires_gl31 %Extension @extension{ARB,texture_rectangle}
* @requires_gl Rectangle textures are not available in OpenGL ES. * @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 /** @overload
* @requires_gl32 %Extension @extension{ARB,texture_multisample} * @requires_gl32 %Extension @extension{ARB,texture_multisample}
* @requires_gl Multisample textures are not available in OpenGL ES. * @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 #endif
/** /**
@ -594,7 +594,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @requires_gl32 %Extension @extension{ARB,texture_multisample} * @requires_gl32 %Extension @extension{ARB,texture_multisample}
* @requires_gl Multisample textures are not available in OpenGL ES. * @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 #endif
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED

4
src/Magnum/Test/FramebufferGLTest.cpp

@ -486,8 +486,8 @@ void FramebufferGLTest::attachRectangleTexture() {
depthStencil.setStorage(TextureFormat::Depth24Stencil8, Vector2i(128)); depthStencil.setStorage(TextureFormat::Depth24Stencil8, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)}); Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color, 0) framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color)
.attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); .attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil);
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete);

Loading…
Cancel
Save