|
|
|
|
@ -1090,6 +1090,28 @@ void TextureArrayGLTest::compressedSubImage2D() {
|
|
|
|
|
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
/* Compressed pixel storage for array textures is underspecified. If the
|
|
|
|
|
extension is supported, first test with default values to ensure we are |
|
|
|
|
not that far off, then continue as usual */ |
|
|
|
|
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) { |
|
|
|
|
Texture2DArray texture; |
|
|
|
|
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, |
|
|
|
|
Vector3i{12, 4, 4}, CompressedZero2D}); |
|
|
|
|
texture.setCompressedSubImage(0, {4, 0, 1}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, CompressedData2D}); |
|
|
|
|
|
|
|
|
|
MAGNUM_VERIFY_NO_ERROR(); |
|
|
|
|
|
|
|
|
|
CompressedImage3D image = texture.compressedImage(0, {}); |
|
|
|
|
|
|
|
|
|
MAGNUM_VERIFY_NO_ERROR(); |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); |
|
|
|
|
CORRADE_COMPARE_AS( |
|
|
|
|
Containers::ArrayView<const UnsignedByte>(image.data<UnsignedByte>(), image.data().size()), Containers::ArrayView<const UnsignedByte>{CompressedSubData2DComplete}, TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
Texture2DArray texture; |
|
|
|
|
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, |
|
|
|
|
Vector3i{12, 4, 4}, CompressedZero2D}); |
|
|
|
|
@ -1151,6 +1173,28 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() {
|
|
|
|
|
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
/* Compressed pixel storage for array textures is underspecified. If the
|
|
|
|
|
extension is supported, first test with default values to ensure we are |
|
|
|
|
not that far off, then continue as usual */ |
|
|
|
|
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) { |
|
|
|
|
Texture2DArray texture; |
|
|
|
|
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, |
|
|
|
|
Vector3i{12, 4, 4}, CompressedZero2D}); |
|
|
|
|
texture.setCompressedSubImage(0, {4, 0, 1}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, CompressedData2D}); |
|
|
|
|
|
|
|
|
|
MAGNUM_VERIFY_NO_ERROR(); |
|
|
|
|
|
|
|
|
|
CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead); |
|
|
|
|
const auto imageData = image.buffer().data<UnsignedByte>(); |
|
|
|
|
|
|
|
|
|
MAGNUM_VERIFY_NO_ERROR(); |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); |
|
|
|
|
CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{CompressedSubData2DComplete}, TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
Texture2DArray texture; |
|
|
|
|
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, |
|
|
|
|
Vector3i{12, 4, 4}, CompressedZero2D}); |
|
|
|
|
|