@ -1363,17 +1363,17 @@ void AbstractTexture::subImageImplementationDefault(GLint level, const Math::Vec
glTexSubImage1D ( _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , GLenum ( type ) , data ) ;
glTexSubImage1D ( _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDefault ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDefault ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
bindInternal ( ) ;
bindInternal ( ) ;
glCompressedTexSubImage1D ( _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTexSubImage1D ( _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , dataSize , data ) ;
}
}
void AbstractTexture : : subImageImplementationDSA ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const PixelFormat format , const PixelType type , const GLvoid * const data ) {
void AbstractTexture : : subImageImplementationDSA ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const PixelFormat format , const PixelType type , const GLvoid * const data ) {
glTextureSubImage1D ( _id , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , GLenum ( type ) , data ) ;
glTextureSubImage1D ( _id , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDSA ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDSA ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
glCompressedTextureSubImage1D ( _id , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTextureSubImage1D ( _id , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , dataSize , data ) ;
}
}
void AbstractTexture : : subImageImplementationDSAEXT ( GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , PixelFormat format , PixelType type , const GLvoid * data ) {
void AbstractTexture : : subImageImplementationDSAEXT ( GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , PixelFormat format , PixelType type , const GLvoid * data ) {
@ -1381,9 +1381,9 @@ void AbstractTexture::subImageImplementationDSAEXT(GLint level, const Math::Vect
glTextureSubImage1DEXT ( _id , _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , GLenum ( type ) , data ) ;
glTextureSubImage1DEXT ( _id , _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDSAEXT ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDSAEXT ( const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLsizei > & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
_flags | = ObjectFlag : : Created ;
_flags | = ObjectFlag : : Created ;
glCompressedTextureSubImage1DEXT ( _id , _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTextureSubImage1DEXT ( _id , _target , level , offset [ 0 ] , size [ 0 ] , GLenum ( format ) , dataSize , data ) ;
}
}
# endif
# endif
@ -1392,9 +1392,9 @@ void AbstractTexture::subImageImplementationDefault(GLint level, const Vector2i&
glTexSubImage2D ( _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
glTexSubImage2D ( _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDefault ( const GLint level , const Vector2i & offset , const Vector2i & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDefault ( const GLint level , const Vector2i & offset , const Vector2i & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
bindInternal ( ) ;
bindInternal ( ) ;
glCompressedTexSubImage2D ( _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTexSubImage2D ( _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , dataSize , data ) ;
}
}
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
@ -1402,8 +1402,8 @@ void AbstractTexture::subImageImplementationDSA(const GLint level, const Vector2
glTextureSubImage2D ( _id , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
glTextureSubImage2D ( _id , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDSA ( const GLint level , const Vector2i & offset , const Vector2i & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDSA ( const GLint level , const Vector2i & offset , const Vector2i & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
glCompressedTextureSubImage2D ( _id , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTextureSubImage2D ( _id , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , dataSize , data ) ;
}
}
void AbstractTexture : : subImageImplementationDSAEXT ( GLint level , const Vector2i & offset , const Vector2i & size , PixelFormat format , PixelType type , const GLvoid * data ) {
void AbstractTexture : : subImageImplementationDSAEXT ( GLint level , const Vector2i & offset , const Vector2i & size , PixelFormat format , PixelType type , const GLvoid * data ) {
@ -1411,9 +1411,9 @@ void AbstractTexture::subImageImplementationDSAEXT(GLint level, const Vector2i&
glTextureSubImage2DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
glTextureSubImage2DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDSAEXT ( GLint level , const Vector2i & offset , const Vector2i & size , CompressedPixelFormat format , Corrade : : Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDSAEXT ( GLint level , const Vector2i & offset , const Vector2i & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
_flags | = ObjectFlag : : Created ;
_flags | = ObjectFlag : : Created ;
glCompressedTextureSubImage2DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTextureSubImage2DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , size . x ( ) , size . y ( ) , GLenum ( format ) , dataSize , data ) ;
}
}
# endif
# endif
@ -1435,12 +1435,12 @@ void AbstractTexture::subImageImplementationDefault(GLint level, const Vector3i&
# endif
# endif
}
}
void AbstractTexture : : compressedSubImageImplementationDefault ( const GLint level , const Vector3i & offset , const Vector3i & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDefault ( const GLint level , const Vector3i & offset , const Vector3i & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
bindInternal ( ) ;
bindInternal ( ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
glCompressedTexSubImage3D ( _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTexSubImage3D ( _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , dataSize , data ) ;
# elif !defined(CORRADE_TARGET_NACL)
# elif !defined(CORRADE_TARGET_NACL)
glCompressedTexSubImage3DOES ( _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTexSubImage3DOES ( _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , dataSize , data ) ;
# else
# else
static_cast < void > ( level ) ;
static_cast < void > ( level ) ;
static_cast < void > ( offset ) ;
static_cast < void > ( offset ) ;
@ -1457,8 +1457,8 @@ void AbstractTexture::subImageImplementationDSA(const GLint level, const Vector3
glTextureSubImage3D ( _id , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
glTextureSubImage3D ( _id , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDSA ( const GLint level , const Vector3i & offset , const Vector3i & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDSA ( const GLint level , const Vector3i & offset , const Vector3i & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
glCompressedTextureSubImage3D ( _id , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTextureSubImage3D ( _id , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , dataSize , data ) ;
}
}
void AbstractTexture : : subImageImplementationDSAEXT ( GLint level , const Vector3i & offset , const Vector3i & size , PixelFormat format , PixelType type , const GLvoid * data ) {
void AbstractTexture : : subImageImplementationDSAEXT ( GLint level , const Vector3i & offset , const Vector3i & size , PixelFormat format , PixelType type , const GLvoid * data ) {
@ -1466,9 +1466,9 @@ void AbstractTexture::subImageImplementationDSAEXT(GLint level, const Vector3i&
glTextureSubImage3DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
glTextureSubImage3DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , GLenum ( type ) , data ) ;
}
}
void AbstractTexture : : compressedSubImageImplementationDSAEXT ( const GLint level , const Vector3i & offset , const Vector3i & size , const CompressedPixelFormat format , const Containers : : ArrayView < const GLvoid > data ) {
void AbstractTexture : : compressedSubImageImplementationDSAEXT ( const GLint level , const Vector3i & offset , const Vector3i & size , const CompressedPixelFormat format , const GLvoid * const data , const GLsizei dataSize ) {
_flags | = ObjectFlag : : Created ;
_flags | = ObjectFlag : : Created ;
glCompressedTextureSubImage3DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , data . size ( ) , data ) ;
glCompressedTextureSubImage3DEXT ( _id , _target , level , offset . x ( ) , offset . y ( ) , offset . z ( ) , size . x ( ) , size . y ( ) , size . z ( ) , GLenum ( format ) , dataSize , data ) ;
}
}
# endif
# endif
@ -1502,6 +1502,7 @@ template<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Image<
data = Containers : : Array < char > { dataSize } ;
data = Containers : : Array < char > { dataSize } ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , data . size ( ) , data ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , data . size ( ) , data ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , std : : move ( data ) ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , std : : move ( data ) ) ;
}
}
@ -1521,6 +1522,7 @@ template<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Buffer
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , nullptr , usage ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , nullptr , usage ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , dataSize , nullptr ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , dataSize , nullptr ) ;
}
}
@ -1542,6 +1544,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
data = Containers : : Array < char > { dataSize } ;
data = Containers : : Array < char > { dataSize } ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getCompressedImageImplementation ) ( level , data . size ( ) , data ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getCompressedImageImplementation ) ( level , data . size ( ) , data ) ;
image . setData ( image . storage ( ) , CompressedPixelFormat ( format ) , size , std : : move ( data ) ) ;
image . setData ( image . storage ( ) , CompressedPixelFormat ( format ) , size , std : : move ( data ) ) ;
}
}
@ -1565,6 +1568,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
image . setData ( image . storage ( ) , CompressedPixelFormat ( format ) , size , nullptr , usage ) ;
image . setData ( image . storage ( ) , CompressedPixelFormat ( format ) , size , nullptr , usage ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getCompressedImageImplementation ) ( level , dataSize , nullptr ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getCompressedImageImplementation ) ( level , dataSize , nullptr ) ;
}
}
@ -1586,6 +1590,7 @@ template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint leve
data = Containers : : Array < char > { dataSize } ;
data = Containers : : Array < char > { dataSize } ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
glGetTextureSubImage ( _id , level , paddedOffset . x ( ) , paddedOffset . y ( ) , paddedOffset . z ( ) , paddedSize . x ( ) , paddedSize . y ( ) , paddedSize . z ( ) , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , data . size ( ) , data ) ;
glGetTextureSubImage ( _id , level , paddedOffset . x ( ) , paddedOffset . y ( ) , paddedOffset . z ( ) , paddedSize . x ( ) , paddedSize . y ( ) , paddedSize . z ( ) , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , data . size ( ) , data ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , std : : move ( data ) ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , std : : move ( data ) ) ;
}
}
@ -1609,6 +1614,7 @@ template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint leve
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , nullptr , usage ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , nullptr , usage ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
glGetTextureSubImage ( _id , level , paddedOffset . x ( ) , paddedOffset . y ( ) , paddedOffset . z ( ) , paddedSize . x ( ) , paddedSize . y ( ) , paddedSize . z ( ) , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , dataSize , nullptr ) ;
glGetTextureSubImage ( _id , level , paddedOffset . x ( ) , paddedOffset . y ( ) , paddedOffset . z ( ) , paddedSize . x ( ) , paddedSize . y ( ) , paddedSize . z ( ) , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , dataSize , nullptr ) ;
}
}
@ -1677,46 +1683,54 @@ void AbstractTexture::DataHelper<3>::setStorageMultisample(AbstractTexture& text
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
void AbstractTexture : : DataHelper < 1 > : : setImage ( AbstractTexture & texture , const GLint level , const TextureFormat internalFormat , const ImageView1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setImage ( AbstractTexture & texture , const GLint level , const TextureFormat internalFormat , const ImageView1D & image ) {
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glTexImage1D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) [ 0 ] , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) ) ;
glTexImage1D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) [ 0 ] , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setCompressedImage ( AbstractTexture & texture , const GLint level , const CompressedImageView1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setCompressedImage ( AbstractTexture & texture , const GLint level , const CompressedImageView1D & image ) {
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glCompressedTexImage1D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) [ 0 ] , 0 , image . data ( ) . size ( ) , image . data ( ) ) ;
glCompressedTexImage1D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) [ 0 ] , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) , image . data ( ) ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setImage ( AbstractTexture & texture , const GLint level , const TextureFormat internalFormat , BufferImage1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setImage ( AbstractTexture & texture , const GLint level , const TextureFormat internalFormat , BufferImage1D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glTexImage1D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) [ 0 ] , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , nullptr ) ;
glTexImage1D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) [ 0 ] , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setCompressedImage ( AbstractTexture & texture , const GLint level , CompressedBufferImage1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setCompressedImage ( AbstractTexture & texture , const GLint level , CompressedBufferImage1D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glCompressedTexImage1D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) [ 0 ] , 0 , image . dataSize ( ) , nullptr ) ;
glCompressedTexImage1D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) [ 0 ] , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const ImageView1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const ImageView1D & image ) {
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( ) ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( ) ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const CompressedImageView1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const CompressedImageView1D & image ) {
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , BufferImage1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , BufferImage1D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , CompressedBufferImage1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , CompressedBufferImage1D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , { nullptr , image . dataSize ( ) } ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
}
}
# endif
# endif
@ -1724,29 +1738,45 @@ void AbstractTexture::DataHelper<2>::setImage(AbstractTexture& texture, const GL
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glTexImage2D ( target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) ) ;
glTexImage2D ( target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( )
# ifdef MAGNUM_TARGET_GLES2
+ Implementation : : pixelStorageSkipOffset ( image )
# endif
) ;
}
}
void AbstractTexture : : DataHelper < 2 > : : setCompressedImage ( AbstractTexture & texture , const GLenum target , const GLint level , const CompressedImageView2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setCompressedImage ( AbstractTexture & texture , const GLenum target , const GLint level , const CompressedImageView2D & image ) {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glCompressedTexImage2D ( target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , image . data ( ) . size ( ) , image . data ( ) ) ;
glCompressedTexImage2D ( target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) , image . data ( ) ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : DataHelper < 2 > : : setImage ( AbstractTexture & texture , const GLenum target , const GLint level , const TextureFormat internalFormat , BufferImage2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setImage ( AbstractTexture & texture , const GLenum target , const GLint level , const TextureFormat internalFormat , BufferImage2D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glTexImage2D ( target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , nullptr ) ;
glTexImage2D ( target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 2 > : : setCompressedImage ( AbstractTexture & texture , const GLenum target , const GLint level , CompressedBufferImage2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setCompressedImage ( AbstractTexture & texture , const GLenum target , const GLint level , CompressedBufferImage2D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glCompressedTexImage2D ( target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , image . dataSize ( ) , nullptr ) ;
glCompressedTexImage2D ( target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) , nullptr ) ;
}
}
# endif
# endif
@ -1754,25 +1784,41 @@ void AbstractTexture::DataHelper<2>::setSubImage(AbstractTexture& texture, const
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( ) ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( )
# ifdef MAGNUM_TARGET_GLES2
+ Implementation : : pixelStorageSkipOffset ( image )
# endif
) ;
}
}
void AbstractTexture : : DataHelper < 2 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , const CompressedImageView2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , const CompressedImageView2D & image ) {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) ) ;
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : DataHelper < 2 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , BufferImage2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , BufferImage2D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 2 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , CompressedBufferImage2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , CompressedBufferImage2D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , { nullptr , image . dataSize ( ) } ) ;
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
}
}
# endif
# endif
@ -1781,11 +1827,12 @@ void AbstractTexture::DataHelper<3>::setImage(AbstractTexture& texture, const GL
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
glTexImage3D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) ) ;
glTexImage3D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) ) ;
# elif !defined(CORRADE_TARGET_NACL)
# elif !defined(CORRADE_TARGET_NACL)
glTexImage3DOES ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) ) ;
glTexImage3DOES ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , image . data ( ) + Implementation : : pixelStorageSkipOffset ( image ) ) ;
# else
# else
static_cast < void > ( level ) ;
static_cast < void > ( level ) ;
static_cast < void > ( internalFormat ) ;
static_cast < void > ( internalFormat ) ;
@ -1798,11 +1845,16 @@ void AbstractTexture::DataHelper<3>::setCompressedImage(AbstractTexture& texture
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
glCompressedTexImage3D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , image . data ( ) . size ( ) , image . data ( ) ) ;
glCompressedTexImage3D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) , image . data ( ) ) ;
# elif !defined(CORRADE_TARGET_NACL)
# elif !defined(CORRADE_TARGET_NACL)
glCompressedTexImage3DOES ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , image . data ( ) . size ( ) , image . data ( ) ) ;
glCompressedTexImage3DOES ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) , image . data ( ) ) ;
# else
# else
static_cast < void > ( level ) ;
static_cast < void > ( level ) ;
static_cast < void > ( image ) ;
static_cast < void > ( image ) ;
@ -1814,14 +1866,20 @@ void AbstractTexture::DataHelper<3>::setCompressedImage(AbstractTexture& texture
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : DataHelper < 3 > : : setImage ( AbstractTexture & texture , const GLint level , const TextureFormat internalFormat , BufferImage3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setImage ( AbstractTexture & texture , const GLint level , const TextureFormat internalFormat , BufferImage3D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glTexImage3D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , nullptr ) ;
glTexImage3D ( texture . _target , level , GLint ( internalFormat ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , GLenum ( image . format ( ) ) , GLenum ( image . type ( ) ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 3 > : : setCompressedImage ( AbstractTexture & texture , const GLint level , CompressedBufferImage3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setCompressedImage ( AbstractTexture & texture , const GLint level , CompressedBufferImage3D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
texture . bindInternal ( ) ;
texture . bindInternal ( ) ;
glCompressedTexImage3D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , image . dataSize ( ) , nullptr ) ;
glCompressedTexImage3D ( texture . _target , level , GLenum ( image . format ( ) ) , image . size ( ) . x ( ) , image . size ( ) . y ( ) , image . size ( ) . z ( ) , 0 , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) , nullptr ) ;
}
}
# endif
# endif
@ -1830,26 +1888,42 @@ void AbstractTexture::DataHelper<3>::setSubImage(AbstractTexture& texture, const
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( ) ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( )
# ifdef MAGNUM_TARGET_GLES2
+ Implementation : : pixelStorageSkipOffset ( image )
# endif
) ;
}
}
void AbstractTexture : : DataHelper < 3 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , const CompressedImageView3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , const CompressedImageView3D & image ) {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) ) ;
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : DataHelper < 3 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , BufferImage3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , BufferImage3D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 3 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , CompressedBufferImage3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , CompressedBufferImage3D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , { nullptr , image . dataSize ( ) } ) ;
# ifndef MAGNUM_TARGET_GLES
/* Pixel storage is completely ignored for compressed images on ES, no need
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
}
}
# endif
# endif