Browse Source

Test: test that compressed blocks can be 2D/3D even for 1D/2D images.

pull/680/head
Vladimír Vondruš 10 months ago
parent
commit
dd7b0754a0
  1. 5
      src/Magnum/GL/Test/BufferImageGLTest.cpp
  2. 4
      src/Magnum/Test/ImageTest.cpp
  3. 4
      src/Magnum/Test/ImageViewTest.cpp
  4. 4
      src/Magnum/Trade/Test/ImageDataTest.cpp

5
src/Magnum/GL/Test/BufferImageGLTest.cpp

@ -435,8 +435,11 @@ void BufferImageGLTest::constructInvalidSize() {
void BufferImageGLTest::constructCompressedInvalidBlockSize() { void BufferImageGLTest::constructCompressedInvalidBlockSize() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
/* This is okay */ /* This is all okay. In particular, it's also completely fine that the Y
and Z size is more than 1 for 1D and 2D. GL might disagree about using
S3TC in 1D images, but the construction itself is fine. */
const char data[8]{}; const char data[8]{};
CompressedBufferImage1D{CompressedPixelFormat::SRGBS3tcDxt1, 1, data, BufferUsage::StaticDraw};
CompressedBufferImage2D{CompressedPixelStorage{} CompressedBufferImage2D{CompressedPixelStorage{}
.setCompressedBlockSize({4, 4, 1}) .setCompressedBlockSize({4, 4, 1})
.setCompressedBlockDataSize(8), .setCompressedBlockDataSize(8),

4
src/Magnum/Test/ImageTest.cpp

@ -625,7 +625,9 @@ void ImageTest::constructCompressedUnknownImplementationSpecificBlockSize() {
void ImageTest::constructCompressedInvalidBlockSize() { void ImageTest::constructCompressedInvalidBlockSize() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
/* This is all okay */ /* This is all okay. In particular, it's also completely fine that the Y
and Z size is more than 1 for 1D and 2D. */
CompressedImage1D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, 1, Containers::Array<char>{NoInit, 8}};
CompressedImage2D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, {1, 1}, Containers::Array<char>{NoInit, 8}}; CompressedImage2D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, {1, 1}, Containers::Array<char>{NoInit, 8}};
CompressedImage2D{CompressedPixelStorage{} CompressedImage2D{CompressedPixelStorage{}
.setCompressedBlockSize({4, 5, 6}) .setCompressedBlockSize({4, 5, 6})

4
src/Magnum/Test/ImageViewTest.cpp

@ -869,8 +869,10 @@ void ImageViewTest::constructCompressedUnknownImplementationSpecificBlockSize()
void ImageViewTest::constructCompressedInvalidBlockSize() { void ImageViewTest::constructCompressedInvalidBlockSize() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
/* This is all okay */ /* This is all okay. In particular, it's also completely fine that the Y
and Z size is more than 1 for 1D and 2D. */
char data[8]; char data[8];
CompressedImageView1D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, 1, data};
CompressedImageView2D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, {1, 1}, data}; CompressedImageView2D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, {1, 1}, data};
CompressedImageView2D{CompressedPixelStorage{} CompressedImageView2D{CompressedPixelStorage{}
.setCompressedBlockSize({4, 5, 6}) .setCompressedBlockSize({4, 5, 6})

4
src/Magnum/Trade/Test/ImageDataTest.cpp

@ -855,7 +855,9 @@ void ImageDataTest::constructCompressedUnknownImplementationSpecificBlockSize()
void ImageDataTest::constructCompressedInvalidBlockSize() { void ImageDataTest::constructCompressedInvalidBlockSize() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
/* This is all okay */ /* This is all okay. In particular, it's also completely fine that the Y
and Z size is more than 1 for 1D and 2D. */
ImageData1D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, 1, Containers::Array<char>{NoInit, 8}};
ImageData2D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, {1, 1}, Containers::Array<char>{NoInit, 8}}; ImageData2D{CompressedPixelStorage{}, 666, {4, 5, 6}, 8, {1, 1}, Containers::Array<char>{NoInit, 8}};
ImageData2D{CompressedPixelStorage{} ImageData2D{CompressedPixelStorage{}
.setCompressedBlockSize({4, 5, 6}) .setCompressedBlockSize({4, 5, 6})

Loading…
Cancel
Save