Browse Source

GL: temporarily work around CompressedImage asserts in tests.

Once the block sizes are implicitly taken from known format properties
and supplied to GL instead of being queried from GL or required to be
set by the user in CompressedPixelStorage, this commit will be reverted.
pull/680/head
Vladimír Vondruš 10 months ago
parent
commit
a96fc85736
  1. 12
      src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp
  2. 22
      src/Magnum/GL/Test/CubeMapTextureGLTest.cpp
  3. 12
      src/Magnum/GL/Test/TextureArrayGLTest.cpp
  4. 28
      src/Magnum/GL/Test/TextureGLTest.cpp

12
src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp

@ -842,7 +842,8 @@ void CubeMapTextureArrayGLTest::compressedImage() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedImage3D image = texture.compressedImage(0, {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedImage(0, image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -889,7 +890,8 @@ void CubeMapTextureArrayGLTest::compressedImageBuffer() {
/** @todo How to test this on ES? */ /** @todo How to test this on ES? */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedBufferImage3D image = texture.compressedImage(0, {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedImage(0, image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1312,7 +1314,8 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1379,7 +1382,8 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

22
src/Magnum/GL/Test/CubeMapTextureGLTest.cpp

@ -1317,7 +1317,8 @@ void CubeMapTextureGLTest::compressedImage() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {data.storage}); CompressedImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedImage(CubeMapCoordinate::PositiveX, 0, image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1367,8 +1368,8 @@ void CubeMapTextureGLTest::compressedImageBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, CompressedBufferImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
{data.storage}, BufferUsage::StaticRead); texture.compressedImage(CubeMapCoordinate::PositiveX, 0, image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1529,7 +1530,8 @@ void CubeMapTextureGLTest::immutableCompressedImage() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::NegativeY, 0, {data.storage}); CompressedImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedImage(CubeMapCoordinate::NegativeY, 0, image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1705,7 +1707,8 @@ void CubeMapTextureGLTest::compressedSubImageQuery() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1826,7 +1829,8 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2002,7 +2006,8 @@ void CubeMapTextureGLTest::compressedImage3D() {
if(fails) CORRADE_SKIP("Skipping the rest of the test"); if(fails) CORRADE_SKIP("Skipping the rest of the test");
} }
CompressedImage3D image = texture.compressedImage(0, {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedImage(0, image);
{ {
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
@ -2055,7 +2060,8 @@ void CubeMapTextureGLTest::compressedImage3DBuffer() {
if(fails) CORRADE_SKIP("Skipping the rest of the test"); if(fails) CORRADE_SKIP("Skipping the rest of the test");
} }
CompressedBufferImage3D image = texture.compressedImage(0, {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedImage(0, image, BufferUsage::StaticRead);
{ {
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS

12
src/Magnum/GL/Test/TextureArrayGLTest.cpp

@ -1703,7 +1703,8 @@ void TextureArrayGLTest::compressedImage2D() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedImage3D image = texture.compressedImage(0, {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedImage(0, image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1749,7 +1750,8 @@ void TextureArrayGLTest::compressedImage2DBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedBufferImage3D image = texture.compressedImage(0, {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedImage(0, image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -1948,7 +1950,8 @@ void TextureArrayGLTest::compressedSubImage2DQuery() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2017,7 +2020,8 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

28
src/Magnum/GL/Test/TextureGLTest.cpp

@ -2181,7 +2181,8 @@ void TextureGLTest::compressedImage2D() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedImage2D image = texture.compressedImage(0, {data.storage}); CompressedImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
texture.compressedImage(0, image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2225,7 +2226,8 @@ void TextureGLTest::compressedImage2DBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedBufferImage2D image = texture.compressedImage(0, {data.storage}, BufferUsage::StaticRead); CompressedBufferImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
texture.compressedImage(0, image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2396,8 +2398,8 @@ void TextureGLTest::compressedSubImage2DQuery() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), CompressedImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr};
{data.storage}); texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2460,8 +2462,8 @@ void TextureGLTest::compressedSubImage2DQueryBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedBufferImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), CompressedBufferImage2D image{data.storage, CompressedPixelFormat::RGBAS3tcDxt3, {}, nullptr, BufferUsage::StaticRead};
{data.storage}, BufferUsage::StaticRead); texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2770,7 +2772,8 @@ void TextureGLTest::compressedImage3D() {
/** @todo How to test this on ES? */ /** @todo How to test this on ES? */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedImage3D image = texture.compressedImage(0, {data.storage}); CompressedImage3D image{data.storage, CompressedPixelFormat::RGBABptcUnorm, {}, nullptr};
texture.compressedImage(0, image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -2811,7 +2814,8 @@ void TextureGLTest::compressedImage3DBuffer() {
/** @todo How to test this on ES? */ /** @todo How to test this on ES? */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
CompressedBufferImage3D image = texture.compressedImage(0, {data.storage}, BufferUsage::StaticRead); CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBABptcUnorm, {}, nullptr, BufferUsage::StaticRead};
texture.compressedImage(0, image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -3015,8 +3019,8 @@ void TextureGLTest::compressedSubImage3DQuery() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), CompressedImage3D image{data.storage, CompressedPixelFormat::RGBABptcUnorm, {}, nullptr};
{data.storage}); texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), image);
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
@ -3085,8 +3089,8 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), CompressedBufferImage3D image{data.storage, CompressedPixelFormat::RGBABptcUnorm, {}, nullptr, BufferUsage::StaticRead};
{data.storage}, BufferUsage::StaticRead); texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data(); const auto imageData = image.buffer().data();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

Loading…
Cancel
Save