From b0def187ae1d74b54ccb8893b5bf2bd60c54da40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 25 Jul 2019 19:49:06 +0200 Subject: [PATCH] Mutable image views can be passed via const&. We're not changing the view parameters, only writing to the memory it points to. --- src/Magnum/GL/AbstractFramebuffer.cpp | 5 ++-- src/Magnum/GL/AbstractFramebuffer.h | 2 +- src/Magnum/GL/AbstractTexture.cpp | 35 +++++++++++++-------------- src/Magnum/GL/AbstractTexture.h | 8 +++--- src/Magnum/GL/CubeMapTexture.cpp | 10 ++++---- src/Magnum/GL/CubeMapTexture.h | 12 ++++----- src/Magnum/GL/CubeMapTextureArray.h | 8 +++--- src/Magnum/GL/RectangleTexture.h | 8 +++--- src/Magnum/GL/Texture.h | 8 +++--- src/Magnum/GL/TextureArray.h | 8 +++--- 10 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/Magnum/GL/AbstractFramebuffer.cpp b/src/Magnum/GL/AbstractFramebuffer.cpp index 13947f26e..0b2a84117 100644 --- a/src/Magnum/GL/AbstractFramebuffer.cpp +++ b/src/Magnum/GL/AbstractFramebuffer.cpp @@ -335,7 +335,7 @@ AbstractFramebuffer& AbstractFramebuffer::clearDepthStencil(const Float depth, c } #endif -void AbstractFramebuffer::read(const Range2Di& rectangle, MutableImageView2D& image) { +void AbstractFramebuffer::read(const Range2Di& rectangle, const MutableImageView2D& image) { CORRADE_ASSERT(image.data().data() != nullptr, "GL::AbstractFramebuffer::read(): image view is nullptr", ); CORRADE_ASSERT(image.size() == rectangle.size(), @@ -362,8 +362,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) { /* Replace the storage, proxy to the function taking a view */ image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), rectangle.size(), std::move(data)}; - MutableImageView2D view(image); - read(rectangle, view); + read(rectangle, MutableImageView2D(image)); } Image2D AbstractFramebuffer::read(const Range2Di& rectangle, Image2D&& image) { diff --git a/src/Magnum/GL/AbstractFramebuffer.h b/src/Magnum/GL/AbstractFramebuffer.h index 08bce42bc..59f3c6ff9 100644 --- a/src/Magnum/GL/AbstractFramebuffer.h +++ b/src/Magnum/GL/AbstractFramebuffer.h @@ -415,7 +415,7 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer { * it's not @cpp nullptr @ce and its size is the same as @p rectangle * size. */ - void read(const Range2Di& rectangle, MutableImageView2D& image); + void read(const Range2Di& rectangle, const MutableImageView2D& image); #ifndef MAGNUM_TARGET_GLES2 /** diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp index 3c5047354..4f80b6e50 100644 --- a/src/Magnum/GL/AbstractTexture.cpp +++ b/src/Magnum/GL/AbstractTexture.cpp @@ -1602,7 +1602,7 @@ template void MAGNUM_GL_EXPORT AbstractTexture::image<1>(GLint, Image<1>&); template void MAGNUM_GL_EXPORT AbstractTexture::image<2>(GLint, Image<2>&); template void MAGNUM_GL_EXPORT AbstractTexture::image<3>(GLint, Image<3>&); -template void AbstractTexture::image(GLint level, BasicMutableImageView& image) { +template void AbstractTexture::image(GLint level, const BasicMutableImageView& image) { #ifndef CORRADE_NO_ASSERT const Math::Vector size = DataHelper::imageSize(*this, level); CORRADE_ASSERT(image.data().data() != nullptr, @@ -1616,9 +1616,9 @@ template void AbstractTexture::image(GLint level, BasicM (this->*Context::current().state().texture->getImageImplementation)(level, pixelFormat(image.format()), pixelType(image.format(), image.formatExtra()), image.data().size(), image.data()); } -template void MAGNUM_GL_EXPORT AbstractTexture::image<1>(GLint, BasicMutableImageView<1>&); -template void MAGNUM_GL_EXPORT AbstractTexture::image<2>(GLint, BasicMutableImageView<2>&); -template void MAGNUM_GL_EXPORT AbstractTexture::image<3>(GLint, BasicMutableImageView<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::image<1>(GLint, const BasicMutableImageView<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::image<2>(GLint, const BasicMutableImageView<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::image<3>(GLint, const BasicMutableImageView<3>&); template void AbstractTexture::image(GLint level, BufferImage& image, BufferUsage usage) { const Math::Vector size = DataHelper::imageSize(*this, level); @@ -1670,7 +1670,7 @@ template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<1>(GLint, Compre template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<2>(GLint, CompressedImage<2>&); template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedImage<3>&); -template void AbstractTexture::compressedImage(const GLint level, BasicMutableCompressedImageView& image) { +template void AbstractTexture::compressedImage(const GLint level, const BasicMutableCompressedImageView& image) { #ifndef CORRADE_NO_ASSERT CORRADE_ASSERT(image.data().data() != nullptr, "GL::AbstractTexture::compressedImage(): image view is nullptr", ); @@ -1705,9 +1705,9 @@ template void AbstractTexture::compressedImage(const GLi (this->*Context::current().state().texture->getCompressedImageImplementation)(level, image.data().size(), image.data()); } -template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<1>(GLint, BasicMutableCompressedImageView<1>&); -template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<2>(GLint, BasicMutableCompressedImageView<2>&); -template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<3>(GLint, BasicMutableCompressedImageView<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<1>(GLint, const BasicMutableCompressedImageView<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<2>(GLint, const BasicMutableCompressedImageView<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<3>(GLint, const BasicMutableCompressedImageView<3>&); template void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage& image, BufferUsage usage) { const Math::Vector size = DataHelper::imageSize(*this, level); @@ -1749,15 +1749,14 @@ template void AbstractTexture::subImage(const GLint leve data = Containers::Array{dataSize}; image = Image{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, std::move(data)}; - BasicMutableImageView view(image); - subImage(level, range, view); + subImage(level, range, BasicMutableImageView(image)); } template void MAGNUM_GL_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, Image<1>&); template void MAGNUM_GL_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, Image<2>&); template void MAGNUM_GL_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, Image<3>&); -template void AbstractTexture::subImage(const GLint level, const RangeTypeFor& range, BasicMutableImageView& image) { +template void AbstractTexture::subImage(const GLint level, const RangeTypeFor& range, const BasicMutableImageView& image) { CORRADE_ASSERT(image.data().data() != nullptr, "GL::AbstractTexture::subImage(): image view is nullptr", ); CORRADE_ASSERT(image.size() == range.size(), @@ -1774,9 +1773,9 @@ template void AbstractTexture::subImage(const GLint leve glGetTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), GLenum(pixelFormat(image.format())), GLenum(pixelType(image.format(), image.formatExtra())), image.data().size(), image.data()); } -template void MAGNUM_GL_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, BasicMutableImageView<1>&); -template void MAGNUM_GL_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, BasicMutableImageView<2>&); -template void MAGNUM_GL_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, BasicMutableImageView<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, const BasicMutableImageView<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, const BasicMutableImageView<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, const BasicMutableImageView<3>&); template void AbstractTexture::subImage(const GLint level, const RangeTypeFor& range, BufferImage& image, const BufferUsage usage) { createIfNotAlready(); @@ -1847,7 +1846,7 @@ template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<1>(GLint, con template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedImage<2>&); template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedImage<3>&); -template void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, BasicMutableCompressedImageView& image) { +template void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, const BasicMutableCompressedImageView& image) { #ifndef CORRADE_NO_ASSERT CORRADE_ASSERT(image.data().data() != nullptr, "GL::AbstractTexture::compressedSubImage(): image view is nullptr", ); @@ -1885,9 +1884,9 @@ template void AbstractTexture::compressedSubImage(const glGetCompressedTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), image.data().size(), image.data()); } -template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, BasicMutableCompressedImageView<1>&); -template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, BasicMutableCompressedImageView<2>&); -template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, BasicMutableCompressedImageView<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, const BasicMutableCompressedImageView<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, const BasicMutableCompressedImageView<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, const BasicMutableCompressedImageView<3>&); template void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, CompressedBufferImage& image, const BufferUsage usage) { createIfNotAlready(); diff --git a/src/Magnum/GL/AbstractTexture.h b/src/Magnum/GL/AbstractTexture.h index 6ef2c4488..242f1e6de 100644 --- a/src/Magnum/GL/AbstractTexture.h +++ b/src/Magnum/GL/AbstractTexture.h @@ -489,16 +489,16 @@ class MAGNUM_GL_EXPORT AbstractTexture: public AbstractObject { void generateMipmap(); #ifndef MAGNUM_TARGET_GLES - template void image(GLint level, BasicMutableImageView& image); + template void image(GLint level, const BasicMutableImageView& image); template void image(GLint level, Image& image); template void image(GLint level, BufferImage& image, BufferUsage usage); - template void compressedImage(GLint level, BasicMutableCompressedImageView& image); + template void compressedImage(GLint level, const BasicMutableCompressedImageView& image); template void compressedImage(GLint level, CompressedImage& image); template void compressedImage(GLint level, CompressedBufferImage& image, BufferUsage usage); - template void subImage(GLint level, const RangeTypeFor& range, BasicMutableImageView& image); + template void subImage(GLint level, const RangeTypeFor& range, const BasicMutableImageView& image); template void subImage(GLint level, const RangeTypeFor& range, Image& image); template void subImage(GLint level, const RangeTypeFor& range, BufferImage& image, BufferUsage usage); - template void compressedSubImage(GLint level, const RangeTypeFor& range, BasicMutableCompressedImageView& image); + template void compressedSubImage(GLint level, const RangeTypeFor& range, const BasicMutableCompressedImageView& image); template void compressedSubImage(GLint level, const RangeTypeFor& range, CompressedImage& image); template void compressedSubImage(GLint level, const RangeTypeFor& range, CompressedBufferImage& image, BufferUsage usage); #endif diff --git a/src/Magnum/GL/CubeMapTexture.cpp b/src/Magnum/GL/CubeMapTexture.cpp index 430047c02..1a72defed 100644 --- a/src/Magnum/GL/CubeMapTexture.cpp +++ b/src/Magnum/GL/CubeMapTexture.cpp @@ -85,7 +85,7 @@ Image3D CubeMapTexture::image(const Int level, Image3D&& image) { return std::move(image); } -void CubeMapTexture::image(const Int level, MutableImageView3D& image) { +void CubeMapTexture::image(const Int level, const MutableImageView3D& image) { #ifndef CORRADE_NO_ASSERT const Vector3i size{imageSize(level), 6}; CORRADE_ASSERT(image.data().data() != nullptr, @@ -154,7 +154,7 @@ CompressedImage3D CubeMapTexture::compressedImage(const Int level, CompressedIma return std::move(image); } -void CubeMapTexture::compressedImage(const Int level, MutableCompressedImageView3D& image) { +void CubeMapTexture::compressedImage(const Int level, const MutableCompressedImageView3D& image) { #ifndef CORRADE_NO_ASSERT CORRADE_ASSERT(image.data().data() != nullptr, "GL::CubeMapTexture::compressedImage(): image view is nullptr", ); @@ -241,7 +241,7 @@ Image2D CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int leve return std::move(image); } -void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, MutableImageView2D& image) { +void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, const MutableImageView2D& image) { #ifndef CORRADE_NO_ASSERT const Vector2i size = imageSize(level); CORRADE_ASSERT(image.data().data() != nullptr, @@ -308,7 +308,7 @@ CompressedImage2D CubeMapTexture::compressedImage(const CubeMapCoordinate coordi return std::move(image); } -void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, MutableCompressedImageView2D& image) { +void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, const MutableCompressedImageView2D& image) { #ifndef CORRADE_NO_ASSERT CORRADE_ASSERT(image.data().data() != nullptr, "GL::CubeMapTexture::compressedImage(): image view is nullptr", ); @@ -420,7 +420,7 @@ CompressedImage3D CubeMapTexture::compressedSubImage(const Int level, const Rang return std::move(image); } -void CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, MutableCompressedImageView3D& image) { +void CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, const MutableCompressedImageView3D& image) { #ifndef CORRADE_NO_ASSERT CORRADE_ASSERT(image.data().data() != nullptr, "GL::CubeMapTexture::compressedSubImage(): image view is nullptr", ); diff --git a/src/Magnum/GL/CubeMapTexture.h b/src/Magnum/GL/CubeMapTexture.h index 96690e016..707ec6f3e 100644 --- a/src/Magnum/GL/CubeMapTexture.h +++ b/src/Magnum/GL/CubeMapTexture.h @@ -572,7 +572,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { * into the memory provided by @p image, expecting it's not * @cpp nullptr @ce and its size is the same as size of given @p level. */ - void image(Int level, MutableImageView3D& image); + void image(Int level, const MutableImageView3D& image); /** * @brief Read given texture mip level to a buffer image @@ -631,7 +631,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as size of given @p level. */ - void compressedImage(Int level, MutableCompressedImageView3D& image); + void compressedImage(Int level, const MutableCompressedImageView3D& image); /** * @brief Read given compressed texture mip level to a buffer image @@ -698,7 +698,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { * expecting it's not @cpp nullptr @ce and its size is the same as size * of given @p level. */ - void image(CubeMapCoordinate coordinate, Int level, MutableImageView2D& image); + void image(CubeMapCoordinate coordinate, Int level, const MutableImageView2D& image); /** * @brief Read given texture mip level and coordinate to a buffer image @@ -764,7 +764,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as size of given @p level. */ - void compressedImage(CubeMapCoordinate coordinate, Int level, MutableCompressedImageView2D& image); + void compressedImage(CubeMapCoordinate coordinate, Int level, const MutableCompressedImageView2D& image); /** * @brief Read given compressed texture mip level and coordinate to a buffer image @@ -819,7 +819,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { * expecting it's not @cpp nullptr @ce and its size is the same as * @p range size. */ - void subImage(Int level, const Range3Di& range, MutableImageView3D& image) { + void subImage(Int level, const Range3Di& range, const MutableImageView3D& image) { AbstractTexture::subImage<3>(level, range, image); } @@ -879,7 +879,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as @p range size. */ - void compressedSubImage(Int level, const Range3Di& range, MutableCompressedImageView3D& image); + void compressedSubImage(Int level, const Range3Di& range, const MutableCompressedImageView3D& image); /** * @brief Read a range of given compressed texture mip level to a buffer image diff --git a/src/Magnum/GL/CubeMapTextureArray.h b/src/Magnum/GL/CubeMapTextureArray.h index 747cdc330..62fbb367f 100644 --- a/src/Magnum/GL/CubeMapTextureArray.h +++ b/src/Magnum/GL/CubeMapTextureArray.h @@ -492,7 +492,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture { * into the memory provided by @p image, expecting it's not * @cpp nullptr @ce and its size is the same as size of given @p level. */ - void image(Int level, MutableImageView3D& image) { + void image(Int level, const MutableImageView3D& image) { AbstractTexture::image<3>(level, image); } @@ -548,7 +548,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as size of given @p level. */ - void compressedImage(Int level, MutableCompressedImageView3D& image) { + void compressedImage(Int level, const MutableCompressedImageView3D& image) { AbstractTexture::compressedImage<3>(level, image); } @@ -605,7 +605,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture { * expecting it's not @cpp nullptr @ce and its size is the same as * @p range size. */ - void subImage(Int level, const Range3Di& range, MutableImageView3D& image) { + void subImage(Int level, const Range3Di& range, const MutableImageView3D& image) { AbstractTexture::subImage<3>(level, range, image); } @@ -667,7 +667,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as @p range size. */ - void compressedSubImage(Int level, const Range3Di& range, MutableCompressedImageView3D& image) { + void compressedSubImage(Int level, const Range3Di& range, const MutableCompressedImageView3D& image) { AbstractTexture::compressedSubImage<3>(level, range, image); } diff --git a/src/Magnum/GL/RectangleTexture.h b/src/Magnum/GL/RectangleTexture.h index 019b24988..2fa210155 100644 --- a/src/Magnum/GL/RectangleTexture.h +++ b/src/Magnum/GL/RectangleTexture.h @@ -376,7 +376,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture { * the memory provided by @p image, expecting it's not @cpp nullptr @ce * and its size is the same as texture size. */ - void image(MutableImageView2D& image) { + void image(const MutableImageView2D& image) { AbstractTexture::image<2>(0, image); } @@ -426,7 +426,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture { * it's not @cpp nullptr @ce, its format is the same as texture format * and its size is the same as texture size. */ - void compressedImage(MutableCompressedImageView2D& image) { + void compressedImage(const MutableCompressedImageView2D& image) { AbstractTexture::compressedImage<2>(0, image); } @@ -476,7 +476,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture { * reads the pixels into the memory provided by @p image, expecting * it's not @cpp nullptr @ce and its size is the same as @p range size. */ - void subImage(const Range2Di& range, MutableImageView2D& image) { + void subImage(const Range2Di& range, const MutableImageView2D& image) { AbstractTexture::subImage<2>(0, range, image); } @@ -532,7 +532,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as @p range size. */ - void compressedSubImage(const Range2Di& range, MutableCompressedImageView2D& image) { + void compressedSubImage(const Range2Di& range, const MutableCompressedImageView2D& image) { AbstractTexture::compressedSubImage<2>(0, range, image); } diff --git a/src/Magnum/GL/Texture.h b/src/Magnum/GL/Texture.h index 594590912..c62da3ffa 100644 --- a/src/Magnum/GL/Texture.h +++ b/src/Magnum/GL/Texture.h @@ -794,7 +794,7 @@ template class Texture: public AbstractTexture { * the pixels into the memory provided by @p image, expecting it's not * @cpp nullptr @ce and its size is the same as size of given @p level. */ - void image(Int level, BasicMutableImageView& image) { + void image(Int level, const BasicMutableImageView& image) { AbstractTexture::image(level, image); } @@ -877,7 +877,7 @@ template class Texture: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as size of given @p level. */ - void compressedImage(Int level, BasicMutableCompressedImageView& image) { + void compressedImage(Int level, const BasicMutableCompressedImageView& image) { AbstractTexture::compressedImage(level, image); } @@ -949,7 +949,7 @@ template class Texture: public AbstractTexture { * expecting it's not @cpp nullptr @ce and its size is the same as * @p range size. */ - void subImage(Int level, const RangeTypeFor& range, BasicMutableImageView& image) { + void subImage(Int level, const RangeTypeFor& range, const BasicMutableImageView& image) { AbstractTexture::subImage(level, range, image); } @@ -1030,7 +1030,7 @@ template class Texture: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as @p range size. */ - void compressedSubImage(Int level, const RangeTypeFor& range, BasicMutableCompressedImageView& image) { + void compressedSubImage(Int level, const RangeTypeFor& range, const BasicMutableCompressedImageView& image) { AbstractTexture::compressedSubImage(level, range, image); } diff --git a/src/Magnum/GL/TextureArray.h b/src/Magnum/GL/TextureArray.h index 1cd461ce4..9e895261b 100644 --- a/src/Magnum/GL/TextureArray.h +++ b/src/Magnum/GL/TextureArray.h @@ -529,7 +529,7 @@ template class TextureArray: public AbstractTexture { * the pixels into the memory provided by @p image, expecting it's not * @cpp nullptr @ce and its size is the same as size of given @p level. */ - void image(Int level, BasicMutableImageView& image) { + void image(Int level, const BasicMutableImageView& image) { AbstractTexture::image(level, image); } @@ -585,7 +585,7 @@ template class TextureArray: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as size of given @p level. */ - void compressedImage(Int level, BasicMutableCompressedImageView& image) { + void compressedImage(Int level, const BasicMutableCompressedImageView& image) { AbstractTexture::compressedImage(level, image); } @@ -642,7 +642,7 @@ template class TextureArray: public AbstractTexture { * expecting it's not @cpp nullptr @ce and its size is the same as * @p range size. */ - void subImage(Int level, const RangeTypeFor& range, BasicMutableImageView& image) { + void subImage(Int level, const RangeTypeFor& range, const BasicMutableImageView& image) { AbstractTexture::subImage(level, range, image); } @@ -704,7 +704,7 @@ template class TextureArray: public AbstractTexture { * expecting it's not @cpp nullptr @ce, its format is the same as * texture format and its size is the same as @p range size. */ - void compressedSubImage(Int level, const RangeTypeFor& range, BasicMutableCompressedImageView& image) { + void compressedSubImage(Int level, const RangeTypeFor& range, const BasicMutableCompressedImageView& image) { AbstractTexture::compressedSubImage(level, range, image); }