From 98e6f513b438b9bd8c0316d5bf1c3ca85b9a0d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 29 Aug 2015 17:52:57 +0200 Subject: [PATCH] Properly unbind pixel pack buffer in Framebuffer::read(Image). --- src/Magnum/AbstractFramebuffer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/AbstractFramebuffer.cpp index bdbecce59..cccc9ca0f 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/src/Magnum/AbstractFramebuffer.cpp @@ -281,6 +281,9 @@ AbstractFramebuffer& AbstractFramebuffer::clear(const FramebufferClearMask mask) void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) { bindInternal(FramebufferTarget::Read); Containers::Array data{Implementation::imageDataSizeFor(image, rectangle.size())}; + #ifndef MAGNUM_TARGET_GLES2 + Buffer::unbindInternal(Buffer::TargetHint::PixelPack); + #endif (Context::current()->state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), data.size(), data); image.setData(image.storage(), image.format(), image.type(), rectangle.size(), std::move(data)); }