From 04ed2271e5ff2bbab5e9f395b438b4191f66e5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 1 Jul 2025 13:58:21 +0200 Subject: [PATCH] GL: CompressedPixelStorage is available everywhere, no need for ifdefs. This likely originates in pre-2018 state of the repo where the GL wrapper was part of the main library and CompressedPixelStorage wasn't a thing on ES simply because there was no such extension. --- .../GL/Test/CubeMapTextureArrayGLTest.cpp | 18 ------------------ src/Magnum/GL/Test/CubeMapTextureGLTest.cpp | 14 -------------- src/Magnum/GL/Test/TextureArrayGLTest.cpp | 18 +----------------- src/Magnum/GL/Test/TextureGLTest.cpp | 12 ------------ 4 files changed, 1 insertion(+), 61 deletions(-) diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp index c78d1ddb2..99505f42d 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp @@ -180,17 +180,13 @@ constexpr UnsignedByte CompressedData[]{ const struct { const char* name; Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES CompressedPixelStorage storage; - #endif Containers::ArrayView dataSparse; std::size_t offset; } CompressedPixelStorageData[]{ {"default pixel storage", Containers::arrayView(CompressedData).exceptPrefix(16*4), - #ifndef MAGNUM_TARGET_GLES {}, - #endif Containers::arrayView(CompressedData).exceptPrefix(16*4), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", @@ -253,17 +249,13 @@ constexpr UnsignedByte CompressedSubData[] = { const struct { const char* name; Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES CompressedPixelStorage storage; - #endif Containers::ArrayView dataSparse; std::size_t offset; } CompressedSubPixelStorageData[]{ {"default pixel storage", Containers::arrayView(CompressedSubData).exceptPrefix(16*4), - #ifndef MAGNUM_TARGET_GLES {}, - #endif Containers::arrayView(CompressedSubData).exceptPrefix(16*4), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", @@ -843,9 +835,7 @@ void CubeMapTextureArrayGLTest::compressedImage() { CubeMapTextureArray texture; texture.setCompressedImage(0, CompressedImageView3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 6}, data.dataSparse}); @@ -890,9 +880,7 @@ void CubeMapTextureArrayGLTest::compressedImageBuffer() { CubeMapTextureArray texture; texture.setCompressedImage(0, CompressedBufferImage3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 6}, data.dataSparse, BufferUsage::StaticDraw}); @@ -928,9 +916,7 @@ void CubeMapTextureArrayGLTest::compressedImageQueryView() { CubeMapTextureArray texture; texture.setCompressedImage(0, CompressedImageView3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 6}, data.dataSparse}); @@ -1238,9 +1224,7 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedZero}); texture.setCompressedSubImage(0, {4, 4, 1}, CompressedImageView3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{4}, data.dataSparse}); @@ -1286,9 +1270,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageBuffer() { texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedZero}); texture.setCompressedSubImage(0, {4, 4, 1}, CompressedBufferImage3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{4}, data.dataSparse, BufferUsage::StaticDraw}); diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index 89ba66d6c..1ce9d1799 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp @@ -221,17 +221,13 @@ constexpr UnsignedByte CompressedData[]{ const struct { const char* name; Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES CompressedPixelStorage storage; - #endif Containers::ArrayView dataSparse; std::size_t offset; } CompressedPixelStorageData[]{ {"default pixel storage", Containers::arrayView(CompressedData).exceptPrefix(16), - #ifndef MAGNUM_TARGET_GLES {}, - #endif Containers::arrayView(CompressedData).exceptPrefix(16), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Y", @@ -1312,9 +1308,7 @@ void CubeMapTextureGLTest::compressedImage() { #endif const CompressedImageView2D view{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse}; @@ -1363,9 +1357,7 @@ void CubeMapTextureGLTest::compressedImageBuffer() { #endif CompressedBufferImage2D buffer{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse, BufferUsage::StaticDraw}; @@ -1547,9 +1539,7 @@ void CubeMapTextureGLTest::immutableCompressedImage() { specs so I suspect it's a bug). */ const CompressedImageView2D view{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse}; @@ -1640,9 +1630,7 @@ void CubeMapTextureGLTest::compressedSubImage() { texture.setCompressedImage(CubeMapCoordinate::NegativeZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); texture.setCompressedSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i{4}, CompressedImageView2D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse}); @@ -1701,9 +1689,7 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { texture.setCompressedImage(CubeMapCoordinate::NegativeZ, 0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero}); texture.setCompressedSubImage(CubeMapCoordinate::PositiveX, 0, Vector2i{4}, CompressedBufferImage2D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse, BufferUsage::StaticDraw}); diff --git a/src/Magnum/GL/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp index f971dec07..de46197cf 100644 --- a/src/Magnum/GL/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayGLTest.cpp @@ -274,17 +274,13 @@ constexpr UnsignedByte CompressedData2D[]{ const struct { const char* name; Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES CompressedPixelStorage storage; - #endif Containers::ArrayView dataSparse; std::size_t offset; } CompressedPixelStorage2DData[]{ {"default pixel storage", Containers::arrayView(CompressedData2D).exceptPrefix(16), - #ifndef MAGNUM_TARGET_GLES {}, - #endif Containers::arrayView(CompressedData2D).exceptPrefix(16), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Z", @@ -1700,9 +1696,7 @@ void TextureArrayGLTest::compressedImage2D() { Texture2DArray texture; texture.setCompressedImage(0, CompressedImageView3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, data.dataSparse}); @@ -1747,9 +1741,7 @@ void TextureArrayGLTest::compressedImage2DBuffer() { Texture2DArray texture; texture.setCompressedImage(0, CompressedBufferImage3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, data.dataSparse, BufferUsage::StaticDraw}); @@ -1867,9 +1859,7 @@ void TextureArrayGLTest::compressedSubImage2D() { texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{12, 4, 4}, CompressedZero2D}); texture.setCompressedSubImage(0, {4, 0, 1}, CompressedImageView3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, data.dataSparse}); @@ -1915,9 +1905,7 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{12, 4, 4}, CompressedZero2D}); texture.setCompressedSubImage(0, {4, 0, 1}, CompressedBufferImage3D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, data.dataSparse, BufferUsage::StaticDraw}); @@ -2029,11 +2017,7 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { MAGNUM_VERIFY_NO_GL_ERROR(); - CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), { - #ifndef MAGNUM_TARGET_GLES - data.storage - #endif - }, BufferUsage::StaticRead); + CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {data.storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); MAGNUM_VERIFY_NO_GL_ERROR(); diff --git a/src/Magnum/GL/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp index 329ca0e20..77d740dd9 100644 --- a/src/Magnum/GL/Test/TextureGLTest.cpp +++ b/src/Magnum/GL/Test/TextureGLTest.cpp @@ -366,17 +366,13 @@ constexpr UnsignedByte CompressedData2D[]{ const struct { const char* name; Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES CompressedPixelStorage storage; - #endif Containers::ArrayView dataSparse; std::size_t offset; } CompressedPixelStorage2DData[]{ {"default pixel storage", Containers::arrayView(CompressedData2D).exceptPrefix(16), - #ifndef MAGNUM_TARGET_GLES {}, - #endif Containers::arrayView(CompressedData2D).exceptPrefix(16), 0}, #ifndef MAGNUM_TARGET_GLES {"skip Y", @@ -2178,9 +2174,7 @@ void TextureGLTest::compressedImage2D() { Texture2D texture; texture.setCompressedImage(0, CompressedImageView2D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse}); @@ -2223,9 +2217,7 @@ void TextureGLTest::compressedImage2DBuffer() { Texture2D texture; texture.setCompressedImage(0, CompressedBufferImage2D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse, BufferUsage::StaticDraw}); @@ -2320,9 +2312,7 @@ void TextureGLTest::compressedSubImage2D() { texture.setCompressedImage(0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4}, CompressedZero2D}); texture.setCompressedSubImage(0, {4, 0}, CompressedImageView2D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse}); @@ -2365,9 +2355,7 @@ void TextureGLTest::compressedSubImage2DBuffer() { texture.setCompressedImage(0, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4}, CompressedZero2D}); texture.setCompressedSubImage(0, {4, 0}, CompressedBufferImage2D{ - #ifndef MAGNUM_TARGET_GLES data.storage, - #endif CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, data.dataSparse, BufferUsage::StaticDraw});