From cb1895536ca2a834fdd58cd4e58070cf4922b2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 8 Feb 2015 11:37:21 +0100 Subject: [PATCH] Ensure that pixel pack buffer is not bound when reading image to RAM. GLnext can't be here soon enough. --- src/Magnum/AbstractTexture.cpp | 1 + src/Magnum/CubeMapTexture.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 22b310c62..ec883f8c7 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -1233,6 +1233,7 @@ template void AbstractTexture::image(GLint level, Image< const Math::Vector size = DataHelper::imageSize(*this, level); const std::size_t dataSize = image.dataSize(size); char* data = new char[dataSize]; + Buffer::unbindInternal(Buffer::TargetHint::PixelPack); (this->*Context::current()->state().texture->getImageImplementation)(level, image.format(), image.type(), dataSize, data); image.setData(image.format(), image.type(), size, data); } diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 9715ba6d5..f27704386 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -60,6 +60,7 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, Image2D const Vector2i size = imageSize(level); const std::size_t dataSize = image.dataSize(size); char* data = new char[dataSize]; + Buffer::unbindInternal(Buffer::TargetHint::PixelPack); (this->*Context::current()->state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), dataSize, data); image.setData(image.format(), image.type(), size, data); }