Browse Source

Fix size computation for array textures in setStorage() fallback.

The comment was right, but the code was apparently copy-pasted. Sadly no
unit test covered this, because nearly every desktop impl has
ARB_texture_storage and on ES2 (which is the only that doesn't have
texture storage) it's not possible to query image size, heh.
pull/77/head
Vladimír Vondruš 12 years ago
parent
commit
b6d9de83dc
  1. 4
      src/Magnum/AbstractTexture.cpp

4
src/Magnum/AbstractTexture.cpp

@ -952,7 +952,7 @@ void AbstractTexture::storageImplementationFallback(const GLenum target, const G
} else if(target == GL_TEXTURE_1D_ARRAY) {
for(GLsizei level = 0; level != levels; ++level)
DataHelper<2>::setImage(*this, target, level, internalFormat,
ImageReference2D{format, type, Math::max(Vector2i(1), size >> level)});
ImageReference2D{format, type, Vector2i{Math::max(1, size.x() >> level), size.y()}});
#endif
/* No other targets are available */
@ -1004,7 +1004,7 @@ void AbstractTexture::storageImplementationFallback(GLenum target, GLsizei level
#endif
for(GLsizei level = 0; level != levels; ++level)
DataHelper<3>::setImage(*this, target, level, internalFormat,
ImageReference3D{format, type, Math::max(Vector3i(1), size >> level)});
ImageReference3D{format, type, Vector3i{Math::max(Vector2i{1}, size.xy() >> level), size.z()}});
#endif
/* No other targets are available */

Loading…
Cancel
Save