diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 79db84848..3a1de6229 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -1094,19 +1094,19 @@ void AbstractTexture::setMaxAnisotropyImplementationExt(GLfloat anisotropy) { } #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -void AbstractTexture::getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values) { +void AbstractTexture::getLevelParameterImplementationDefault(const GLenum target, const GLint level, const GLenum parameter, GLint* const values) { bindInternal(); - glGetTexLevelParameteriv(_target, level, parameter, values); + glGetTexLevelParameteriv(target, level, parameter, values); } #ifndef MAGNUM_TARGET_GLES -void AbstractTexture::getLevelParameterImplementationDSA(const GLint level, const GLenum parameter, GLint* const values) { +void AbstractTexture::getLevelParameterImplementationDSA(GLenum, const GLint level, const GLenum parameter, GLint* const values) { glGetTextureLevelParameteriv(_id, level, parameter, values); } -void AbstractTexture::getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values) { +void AbstractTexture::getLevelParameterImplementationDSAEXT(const GLenum target, const GLint level, const GLenum parameter, GLint* const values) { _flags |= ObjectFlag::Created; - glGetTextureLevelParameterivEXT(_id, _target, level, parameter, values); + glGetTextureLevelParameterivEXT(_id, target, level, parameter, values); } #endif #endif @@ -1493,7 +1493,7 @@ void AbstractTexture::invalidateSubImageImplementationARB(GLint level, const Vec #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES template void AbstractTexture::image(GLint level, Image& image) { - const Math::Vector size = DataHelper::imageSize(*this, level); + const Math::Vector size = DataHelper::imageSize(*this, _target, level); const std::size_t dataSize = Implementation::imageDataSizeFor(image, size); /* Reallocate only if needed */ @@ -1512,7 +1512,7 @@ template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, Image<2>&); template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, Image<3>&); template void AbstractTexture::image(GLint level, BufferImage& image, BufferUsage usage) { - const Math::Vector size = DataHelper::imageSize(*this, level); + const Math::Vector size = DataHelper::imageSize(*this, _target, level); const std::size_t dataSize = Implementation::imageDataSizeFor(image, size); /* Reallocate only if needed */ @@ -1531,12 +1531,12 @@ template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, BufferImage<2>&, Bu template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, BufferUsage); template void AbstractTexture::compressedImage(const GLint level, CompressedImage& image) { - const Math::Vector size = DataHelper::imageSize(*this, level); + const Math::Vector size = DataHelper::imageSize(*this, _target, level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -1554,12 +1554,12 @@ template void MAGNUM_EXPORT AbstractTexture::compressedImage<2>(GLint, Compresse template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedImage<3>&); template void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage& image, BufferUsage usage) { - const Math::Vector size = DataHelper::imageSize(*this, level); + const Math::Vector size = DataHelper::imageSize(*this, _target, level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(_target, level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -1626,30 +1626,30 @@ template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES -Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, const GLint level) { +Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, GLenum, const GLint level) { Math::Vector<1, GLint> value; - (texture.*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*Context::current()->state().texture->getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_WIDTH, &value[0]); return value; } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, const GLint level) { +Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, const GLenum target, const GLint level) { const Implementation::TextureState& state = *Context::current()->state().texture; Vector2i value; - (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); - (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_HEIGHT, &value[1]); + (texture.*state.getLevelParameterivImplementation)(target, level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*state.getLevelParameterivImplementation)(target, level, GL_TEXTURE_HEIGHT, &value[1]); return value; } -Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, const GLint level) { +Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, GLenum, const GLint level) { const Implementation::TextureState& state = *Context::current()->state().texture; Vector3i value; - (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]); - (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_HEIGHT, &value[1]); - (texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_DEPTH, &value[2]); + (texture.*state.getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_WIDTH, &value[0]); + (texture.*state.getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_HEIGHT, &value[1]); + (texture.*state.getLevelParameterivImplementation)(texture._target, level, GL_TEXTURE_DEPTH, &value[2]); return value; } #endif diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index defd3bc1a..5784f1067 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -463,10 +463,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { void MAGNUM_LOCAL setMaxAnisotropyImplementationExt(GLfloat anisotropy); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLenum target, GLint level, GLenum parameter, GLint* values); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); - void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLenum, GLint level, GLenum parameter, GLint* values); + void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLenum target, GLint level, GLenum parameter, GLint* values); #endif #endif @@ -584,7 +584,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { - static Math::Vector<1, GLint> imageSize(AbstractTexture& texture, GLint level); + static Math::Vector<1, GLint> imageSize(AbstractTexture& texture, GLenum, GLint level); static void setWrapping(AbstractTexture& texture, const Array1D& wrapping); @@ -605,7 +605,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { #endif template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - static Vector2i imageSize(AbstractTexture& texture, GLint level); + static Vector2i imageSize(AbstractTexture& texture, GLenum target, GLint level); #endif static void setWrapping(AbstractTexture& texture, const Array2D& wrapping); @@ -647,7 +647,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<3> { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #ifndef MAGNUM_TARGET_GLES2 - static Vector3i imageSize(AbstractTexture& texture, GLint level); + static Vector3i imageSize(AbstractTexture& texture, GLenum, GLint level); #endif static void setWrapping(AbstractTexture& texture, const Array3D& wrapping); diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/CubeMapTexture.cpp index 65e37d48d..cc5a8c382 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/CubeMapTexture.cpp @@ -49,12 +49,6 @@ Vector2i CubeMapTexture::maxSize() { return Vector2i{Implementation::maxCubeMapTextureSideSize()}; } -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -Vector2i CubeMapTexture::imageSize(const Int level) { - return (this->*Context::current()->state().texture->getCubeImageSizeImplementation)(level); -} -#endif - #ifndef MAGNUM_TARGET_GLES void CubeMapTexture::image(const Int level, Image3D& image) { createIfNotAlready(); @@ -105,10 +99,12 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) const Vector3i size{imageSize(level), 6}; GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path + and assume that all other slices are the same */ + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -131,10 +127,12 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i const Vector3i size{imageSize(level), 6}; GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path + and assume that all other slices are the same */ + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -195,10 +193,12 @@ BufferImage2D CubeMapTexture::image(const Coordinate coordinate, const Int level void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedImage2D& image) { const Vector2i size = imageSize(level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path + and assume that all other slices are the same */ + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ Containers::Array data{image.release()}; @@ -219,10 +219,12 @@ CompressedImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, c void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D& image, const BufferUsage usage) { const Vector2i size = imageSize(level); GLint textureDataSize; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); + /* Similarly to imageSize(), use only parameters of +X in pre-DSA code path + and assume that all other slices are the same */ + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize); const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize); GLint format; - (this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); + (this->*Context::current()->state().texture->getLevelParameterivImplementation)(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_INTERNAL_FORMAT, &format); /* Reallocate only if needed */ if(image.dataSize() < dataSize) @@ -335,33 +337,6 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat } #endif -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -Vector2i CubeMapTexture::getImageSizeImplementationDefault(const Int level) { - Vector2i size; - bindInternal(); - glGetTexLevelParameteriv(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_WIDTH, &size.x()); - glGetTexLevelParameteriv(GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_HEIGHT, &size.y()); - return size; -} - -#ifndef MAGNUM_TARGET_GLES -Vector2i CubeMapTexture::getImageSizeImplementationDSA(const Int level) { - Vector2i size; - glGetTextureLevelParameteriv(_id, level, GL_TEXTURE_WIDTH, &size.x()); - glGetTextureLevelParameteriv(_id, level, GL_TEXTURE_HEIGHT, &size.y()); - return size; -} - -Vector2i CubeMapTexture::getImageSizeImplementationDSAEXT(const Int level) { - _flags |= ObjectFlag::Created; - Vector2i size; - glGetTextureLevelParameterivEXT(_id, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_WIDTH, &size.x()); - glGetTextureLevelParameterivEXT(_id, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, GL_TEXTURE_HEIGHT, &size.y()); - return size; -} -#endif -#endif - #ifndef MAGNUM_TARGET_GLES void CubeMapTexture::getImageImplementationDefault(const Coordinate coordinate, const GLint level, const Vector2i&, const PixelFormat format, const PixelType type, std::size_t, GLvoid* const data) { bindInternal(); diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 9b9838189..11331a67e 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -421,7 +421,9 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * @requires_gles Texture image size queries are not available in * WebGL. */ - Vector2i imageSize(Int level); + Vector2i imageSize(Int level) { + return DataHelper<2>::imageSize(*this, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level); + } #ifdef MAGNUM_BUILD_DEPRECATED /** @@ -944,14 +946,6 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { private: explicit CubeMapTexture(GLuint id, ObjectFlags flags) noexcept: AbstractTexture{id, GL_TEXTURE_CUBE_MAP, flags} {} - #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Vector2i MAGNUM_LOCAL getImageSizeImplementationDefault(Int level); - #ifndef MAGNUM_TARGET_GLES - Vector2i MAGNUM_LOCAL getImageSizeImplementationDSA(Int level); - Vector2i MAGNUM_LOCAL getImageSizeImplementationDSAEXT(Int level); - #endif - #endif - #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL getImageImplementationDefault(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); void MAGNUM_LOCAL getImageImplementationDSA(Coordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index 059c05add..880a31128 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -368,7 +368,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * See @ref Texture::imageSize() for more information. */ Vector3i imageSize(Int level) { - return DataHelper<3>::imageSize(*this, level); + return DataHelper<3>::imageSize(*this, _target, level); } #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 7a41fd8be..31f5f582f 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -135,7 +135,6 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferImplementation = &BufferTexture::setBufferImplementationDSA; setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSA; - getCubeImageSizeImplementation = &CubeMapTexture::getImageSizeImplementationDSA; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSA; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSA; @@ -160,7 +159,6 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferImplementation = &BufferTexture::setBufferImplementationDSAEXT; setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDSAEXT; - getCubeImageSizeImplementation = &CubeMapTexture::getImageSizeImplementationDSAEXT; cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDSAEXT; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDSAEXT; @@ -197,9 +195,6 @@ TextureState::TextureState(Context& context, std::vector& extension setBufferRangeImplementation = &BufferTexture::setBufferRangeImplementationDefault; #endif - #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - getCubeImageSizeImplementation = &CubeMapTexture::getImageSizeImplementationDefault; - #endif cubeSubImageImplementation = &CubeMapTexture::subImageImplementationDefault; cubeCompressedSubImageImplementation = &CubeMapTexture::compressedSubImageImplementationDefault; } diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index f6c31be43..b4c9cbc72 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -61,7 +61,7 @@ struct TextureState { #endif void(AbstractTexture::*setMaxAnisotropyImplementation)(GLfloat); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void(AbstractTexture::*getLevelParameterivImplementation)(GLint, GLenum, GLint*); + void(AbstractTexture::*getLevelParameterivImplementation)(GLenum, GLint, GLenum, GLint*); #endif void(AbstractTexture::*mipmapImplementation)(); #ifndef MAGNUM_TARGET_GLES @@ -97,9 +97,6 @@ struct TextureState { void(BufferTexture::*setBufferRangeImplementation)(BufferTextureFormat, Buffer&, GLintptr, GLsizeiptr); #endif - #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Vector2i(CubeMapTexture::*getCubeImageSizeImplementation)(Int); - #endif #ifndef MAGNUM_TARGET_GLES void(CubeMapTexture::*getCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*); void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapTexture::Coordinate, GLint, const Vector2i&, std::size_t, GLvoid*); diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/MultisampleTexture.h index d9d42e3d8..d806d4a0c 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/MultisampleTexture.h @@ -210,7 +210,7 @@ template class MultisampleTexture: public AbstractTextur * OpenGL ES 3.0 and older. */ VectorTypeFor imageSize() { - return DataHelper::imageSize(*this, 0); + return DataHelper::imageSize(*this, _target, 0); } /** diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index 0962c9e7a..dabe8f4c2 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -275,7 +275,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * See @ref Texture::imageSize() for more information. */ - Vector2i imageSize() { return DataHelper<2>::imageSize(*this, 0); } + Vector2i imageSize() { return DataHelper<2>::imageSize(*this, _target, 0); } /** * @brief Read texture to image diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 8bfa7e9bc..3d274b4be 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -625,7 +625,7 @@ template class Texture: public AbstractTexture { * WebGL. */ VectorTypeFor imageSize(Int level) { - return DataHelper::imageSize(*this, level); + return DataHelper::imageSize(*this, _target, level); } #endif diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index e87cba8ec..00867ac36 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -388,7 +388,7 @@ template class TextureArray: public AbstractTexture { * WebGL. */ VectorTypeFor imageSize(Int level) { - return DataHelper::imageSize(*this, level); + return DataHelper::imageSize(*this, _target, level); } #endif