diff --git a/src/Magnum/DebugTools/Test/CMakeLists.txt b/src/Magnum/DebugTools/Test/CMakeLists.txt index a568030e2..73ce4b5ce 100644 --- a/src/Magnum/DebugTools/Test/CMakeLists.txt +++ b/src/Magnum/DebugTools/Test/CMakeLists.txt @@ -98,7 +98,7 @@ if(TARGET_GL) corrade_add_test(DebugToolsTextureImageGLTest TextureImageGLTest.cpp LIBRARIES MagnumDebugTools MagnumOpenGLTester) set_target_properties(DebugToolsTextureImageGLTest PROPERTIES FOLDER "Magnum/DebugTools/Test") - if(NOT (MAGNUM_TARGET_GLES2 AND MAGNUM_TARGET_WEBGL)) + if(NOT MAGNUM_TARGET_WEBGL) corrade_add_test(DebugToolsBufferDataGLTest BufferDataGLTest.cpp LIBRARIES MagnumDebugTools MagnumOpenGLTester) set_target_properties(DebugToolsBufferDataGLTest PROPERTIES FOLDER "Magnum/DebugTools/Test") diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 0bb4b7079..d8fea218b 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -35,7 +35,7 @@ #include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Range.h" -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #include "Magnum/DebugTools/BufferData.h" #include "Magnum/GL/BufferImage.h" #endif @@ -46,13 +46,13 @@ struct TextureImageGLTest: GL::OpenGLTester { explicit TextureImageGLTest(); void subImage2D(); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void subImage2DBuffer(); #endif void subImage2DGeneric(); void subImageCube(); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void subImageCubeBuffer(); #endif @@ -65,13 +65,13 @@ struct TextureImageGLTest: GL::OpenGLTester { TextureImageGLTest::TextureImageGLTest() { addTests({&TextureImageGLTest::subImage2D, - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &TextureImageGLTest::subImage2DBuffer, #endif &TextureImageGLTest::subImage2DGeneric, &TextureImageGLTest::subImageCube, - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &TextureImageGLTest::subImageCubeBuffer, #endif @@ -110,7 +110,7 @@ void TextureImageGLTest::subImage2D() { Containers::arrayView(Data2D), TestSuite::Compare::Container); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureImageGLTest::subImage2DBuffer() { GL::Texture2D texture; texture.setImage(0, GL::TextureFormat::RGBA8, ImageView2D{GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte, Vector2i{2}, Data2D}); @@ -174,7 +174,7 @@ void TextureImageGLTest::subImageCube() { Containers::arrayView(Data2D), TestSuite::Compare::Container); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureImageGLTest::subImageCubeBuffer() { ImageView2D view{GL::PixelFormat::RGBA, GL::PixelType::UnsignedByte, Vector2i{2}, Data2D}; diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index 9036c9ad8..3f84771d5 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/GL/AbstractShaderProgram.h" #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #include "Magnum/GL/ImageFormat.h" #endif #include "Magnum/GL/PixelFormat.h" @@ -79,9 +79,11 @@ struct AbstractShaderProgramGLTest: OpenGLTester { void createUniformBlocks(); void uniformBlockIndexNotFound(); void uniformBlock(); - #endif + #ifndef MAGNUM_TARGET_WEBGL void compute(); + #endif + #endif }; AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { @@ -117,8 +119,10 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { &AbstractShaderProgramGLTest::uniformBlockIndexNotFound, &AbstractShaderProgramGLTest::uniformBlock, + #ifndef MAGNUM_TARGET_WEBGL &AbstractShaderProgramGLTest::compute #endif + #endif }); } @@ -769,6 +773,7 @@ void AbstractShaderProgramGLTest::uniformBlock() { MAGNUM_VERIFY_NO_GL_ERROR(); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgramGLTest::compute() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -847,6 +852,7 @@ void AbstractShaderProgramGLTest::compute() { #endif } #endif +#endif }}} diff --git a/src/Magnum/GL/Test/CMakeLists.txt b/src/Magnum/GL/Test/CMakeLists.txt index 01129fb2e..84b93247a 100644 --- a/src/Magnum/GL/Test/CMakeLists.txt +++ b/src/Magnum/GL/Test/CMakeLists.txt @@ -163,36 +163,42 @@ if(BUILD_GL_TESTS) corrade_add_test(GLAbstractQueryGLTest AbstractQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) corrade_add_test(GLPixelStorageGLTest PixelStorageGLTest.cpp LIBRARIES MagnumOpenGLTester) corrade_add_test(GLSampleQueryGLTest SampleQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(GLTimeQueryGLTest TimeQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) set_target_properties( GLAbstractQueryGLTest GLPixelStorageGLTest GLSampleQueryGLTest - GLTimeQueryGLTest PROPERTIES FOLDER "Magnum/GL/Test") endif() if(NOT MAGNUM_TARGET_GLES2) corrade_add_test(GLBufferImageGLTest BufferImageGLTest.cpp LIBRARIES MagnumGLTestLib MagnumOpenGLTester) - corrade_add_test(GLBufferTextureGLTest BufferTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(GLCubeMapTextureArrayGLTest CubeMapTextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(GLMultisampleTextureGLTest MultisampleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) corrade_add_test(GLPrimitiveQueryGLTest PrimitiveQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) corrade_add_test(GLTextureArrayGLTest TextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) corrade_add_test(GLTransformFeedbackGLTest TransformFeedbackGLTest.cpp LIBRARIES MagnumOpenGLTester) set_target_properties( GLBufferImageGLTest - GLBufferTextureGLTest - GLCubeMapTextureArrayGLTest - GLMultisampleTextureGLTest GLPrimitiveQueryGLTest GLTextureArrayGLTest GLTransformFeedbackGLTest PROPERTIES FOLDER "Magnum/GL/Test") endif() + if(NOT MAGNUM_TARGET_GLES2 AND NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(GLBufferTextureGLTest BufferTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLCubeMapTextureArrayGLTest CubeMapTextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLMultisampleTextureGLTest MultisampleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLTimeQueryGLTest TimeQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) + + set_target_properties( + GLBufferTextureGLTest + GLCubeMapTextureArrayGLTest + GLMultisampleTextureGLTest + GLTimeQueryGLTest + PROPERTIES FOLDER "Magnum/GL/Test") + endif() + if(NOT MAGNUM_TARGET_GLES) corrade_add_test(GLRectangleTextureGLTest RectangleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) set_target_properties(GLRectangleTextureGLTest PROPERTIES FOLDER "Magnum/GL/Test") diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index 8935879ea..f4b9090de 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp @@ -58,7 +58,7 @@ struct CubeMapTextureGLTest: OpenGLTester { #ifndef MAGNUM_TARGET_WEBGL void samplingSrgbDecode(); #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingSwizzle(); #elif !defined(MAGNUM_TARGET_WEBGL) void samplingMaxLevel(); @@ -66,8 +66,6 @@ struct CubeMapTextureGLTest: OpenGLTester { #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingBorderInteger(); - #endif - #ifndef MAGNUM_TARGET_GLES2 void samplingDepthStencilMode(); #endif #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) @@ -313,7 +311,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { #ifndef MAGNUM_TARGET_WEBGL &CubeMapTextureGLTest::samplingSrgbDecode, #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &CubeMapTextureGLTest::samplingSwizzle, #elif !defined(MAGNUM_TARGET_WEBGL) &CubeMapTextureGLTest::samplingMaxLevel, @@ -321,8 +319,6 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &CubeMapTextureGLTest::samplingBorderInteger, - #endif - #ifndef MAGNUM_TARGET_GLES2 &CubeMapTextureGLTest::samplingDepthStencilMode, #endif #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) @@ -513,7 +509,7 @@ void CubeMapTextureGLTest::samplingSrgbDecode() { } #endif -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingSwizzle() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -525,7 +521,9 @@ void CubeMapTextureGLTest::samplingSwizzle() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#elif !defined(MAGNUM_TARGET_WEBGL) +#endif + +#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingMaxLevel() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); @@ -568,9 +566,7 @@ void CubeMapTextureGLTest::samplingBorderInteger() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#endif -#ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::samplingDepthStencilMode() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -613,7 +609,7 @@ void CubeMapTextureGLTest::storage() { MAGNUM_VERIFY_NO_GL_ERROR(); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifdef MAGNUM_TARGET_GLES if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing"); @@ -990,8 +986,13 @@ void CubeMapTextureGLTest::immutableCompressedImage() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::EXT::texture_storage::string() + std::string(" is not supported.")); #endif + #ifndef MAGNUM_TARGET_WEBGL if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + #endif #ifndef MAGNUM_TARGET_GLES if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index d41364561..c5bb514cd 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -40,10 +40,10 @@ #ifndef MAGNUM_TARGET_GLES2 #include "Magnum/GL/BufferImage.h" -#include "Magnum/GL/MultisampleTexture.h" #include "Magnum/GL/TextureArray.h" #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +#include "Magnum/GL/MultisampleTexture.h" #include "Magnum/GL/CubeMapTextureArray.h" #endif #ifndef MAGNUM_TARGET_GLES @@ -80,9 +80,9 @@ struct FramebufferGLTest: OpenGLTester { #endif #ifndef MAGNUM_TARGET_GLES2 void attachTexture2DArray(); - void attachTexture2DMultisample(); #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + void attachTexture2DMultisample(); void attachTexture2DMultisampleArray(); #endif #ifndef MAGNUM_TARGET_GLES @@ -192,9 +192,9 @@ FramebufferGLTest::FramebufferGLTest() { #endif #ifndef MAGNUM_TARGET_GLES2 &FramebufferGLTest::attachTexture2DArray, - &FramebufferGLTest::attachTexture2DMultisample, #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + &FramebufferGLTest::attachTexture2DMultisample, &FramebufferGLTest::attachTexture2DMultisampleArray, #endif #ifndef MAGNUM_TARGET_GLES @@ -632,7 +632,7 @@ void FramebufferGLTest::attachTexture2DArray() { } #endif -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachTexture2DMultisample() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -662,9 +662,7 @@ void FramebufferGLTest::attachTexture2DMultisample() { CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } -#endif -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -1211,6 +1209,7 @@ void FramebufferGLTest::clearDepth() { MAGNUM_VERIFY_NO_GL_ERROR(); + #ifndef MAGNUM_TARGET_WEBGL #ifdef MAGNUM_TARGET_GLES if(Context::current().isExtensionSupported()) #endif @@ -1224,6 +1223,7 @@ void FramebufferGLTest::clearDepth() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(depthImage.data()[0], 48352); } + #endif } void FramebufferGLTest::clearStencil() { @@ -1250,6 +1250,7 @@ void FramebufferGLTest::clearStencil() { MAGNUM_VERIFY_NO_GL_ERROR(); + #ifndef MAGNUM_TARGET_WEBGL #ifdef MAGNUM_TARGET_GLES if(Context::current().isExtensionSupported()) #endif @@ -1263,6 +1264,7 @@ void FramebufferGLTest::clearStencil() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(stencilImage.data()[0], 67); } + #endif } void FramebufferGLTest::clearDepthStencil() { @@ -1289,6 +1291,7 @@ void FramebufferGLTest::clearDepthStencil() { framebuffer.clearDepthStencil(Math::unpack(48352), 67); + #ifndef MAGNUM_TARGET_WEBGL #ifdef MAGNUM_TARGET_GLES if(Context::current().isExtensionSupported()) #endif @@ -1304,6 +1307,7 @@ void FramebufferGLTest::clearDepthStencil() { CORRADE_COMPARE(depthStencilImage.data()[0] >> 8, 12378300); CORRADE_COMPARE(depthStencilImage.data()[0], 67); } + #endif } #endif diff --git a/src/Magnum/GL/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp index 59ad5ed50..2d029c920 100644 --- a/src/Magnum/GL/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayGLTest.cpp @@ -29,7 +29,6 @@ #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" #include "Magnum/GL/BufferImage.h" -#include "Magnum/GL/ImageFormat.h" #include "Magnum/GL/OpenGLTester.h" #include "Magnum/GL/PixelFormat.h" #include "Magnum/GL/TextureArray.h" @@ -37,6 +36,10 @@ #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" +#ifndef MAGNUM_TARGET_WEBGL +#include "Magnum/GL/ImageFormat.h" +#endif + namespace Magnum { namespace GL { namespace Test { struct TextureArrayGLTest: OpenGLTester { @@ -69,10 +72,12 @@ struct TextureArrayGLTest: OpenGLTester { #endif template void sampling2D(); + #ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_GLES void samplingSrgbDecode1D(); #endif void samplingSrgbDecode2D(); + #endif #ifndef MAGNUM_TARGET_GLES void samplingSwizzle1D(); @@ -88,8 +93,10 @@ struct TextureArrayGLTest: OpenGLTester { #ifndef MAGNUM_TARGET_GLES void samplingDepthStencilMode1D(); #endif + #ifndef MAGNUM_TARGET_WEBGL void samplingDepthStencilMode2D(); - #ifdef MAGNUM_TARGET_GLES + #endif + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) void samplingBorder2D(); #endif @@ -286,15 +293,19 @@ TextureArrayGLTest::TextureArrayGLTest() { &TextureArrayGLTest::sampling2D, &TextureArrayGLTest::sampling2D, + #ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::samplingSrgbDecode1D, #endif &TextureArrayGLTest::samplingSrgbDecode2D, + #endif #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::samplingSwizzle1D, #endif + #ifndef MAGNUM_TARGET_WEBGL &TextureArrayGLTest::samplingSwizzle2D, + #endif #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::samplingBorderInteger1D, @@ -305,8 +316,10 @@ TextureArrayGLTest::TextureArrayGLTest() { #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::samplingDepthStencilMode1D, #endif + #ifndef MAGNUM_TARGET_WEBGL &TextureArrayGLTest::samplingDepthStencilMode2D, - #ifdef MAGNUM_TARGET_GLES + #endif + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) &TextureArrayGLTest::samplingBorder2D, #endif @@ -668,6 +681,7 @@ template void TextureArrayGLTest::sampling2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } +#ifndef MAGNUM_TARGET_WEBGL void TextureArrayGLTest::samplingSrgbDecode2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -681,8 +695,9 @@ void TextureArrayGLTest::samplingSrgbDecode2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } +#endif -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureArrayGLTest::samplingSwizzle2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -696,7 +711,9 @@ void TextureArrayGLTest::samplingSwizzle2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#else +#endif + +#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureArrayGLTest::samplingMaxLevel2D() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); @@ -743,7 +760,7 @@ void TextureArrayGLTest::samplingBorderInteger2D() { } #endif -#ifndef MAGNUM_TARGET_GLES2 +#ifndef MAGNUM_TARGET_WEBGL void TextureArrayGLTest::samplingDepthStencilMode2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -762,7 +779,7 @@ void TextureArrayGLTest::samplingDepthStencilMode2D() { } #endif -#ifdef MAGNUM_TARGET_GLES +#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) void TextureArrayGLTest::samplingBorder2D() { if(!Context::current().isExtensionSupported() && !Context::current().isExtensionSupported()) @@ -808,7 +825,7 @@ void TextureArrayGLTest::storage2D() { MAGNUM_VERIFY_NO_GL_ERROR(); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifdef MAGNUM_TARGET_GLES if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing"); diff --git a/src/Magnum/GL/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp index c927cea80..29d41a383 100644 --- a/src/Magnum/GL/Test/TextureGLTest.cpp +++ b/src/Magnum/GL/Test/TextureGLTest.cpp @@ -98,9 +98,12 @@ struct TextureGLTest: OpenGLTester { #ifndef MAGNUM_TARGET_GLES void samplingSwizzle1D(); #endif + #ifndef MAGNUM_TARGET_WEBGL void samplingSwizzle2D(); void samplingSwizzle3D(); - #elif !defined(MAGNUM_TARGET_WEBGL) + #endif + #endif + #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingMaxLevel2D(); void samplingMaxLevel3D(); void samplingCompare2D(); @@ -116,7 +119,7 @@ struct TextureGLTest: OpenGLTester { #ifndef MAGNUM_TARGET_GLES void samplingDepthStencilMode1D(); #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingDepthStencilMode2D(); void samplingDepthStencilMode3D(); #endif @@ -485,9 +488,12 @@ TextureGLTest::TextureGLTest() { #ifndef MAGNUM_TARGET_GLES &TextureGLTest::samplingSwizzle1D, #endif + #ifndef MAGNUM_TARGET_WEBGL &TextureGLTest::samplingSwizzle2D, &TextureGLTest::samplingSwizzle3D, - #elif !defined(MAGNUM_TARGET_WEBGL) + #endif + #endif + #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &TextureGLTest::samplingMaxLevel2D, &TextureGLTest::samplingMaxLevel3D, &TextureGLTest::samplingCompare2D, @@ -503,7 +509,7 @@ TextureGLTest::TextureGLTest() { #ifndef MAGNUM_TARGET_GLES &TextureGLTest::samplingDepthStencilMode1D, #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &TextureGLTest::samplingDepthStencilMode2D, &TextureGLTest::samplingDepthStencilMode3D, #endif @@ -997,7 +1003,7 @@ void TextureGLTest::samplingSrgbDecode2D() { } #endif -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingSwizzle2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -1009,7 +1015,9 @@ void TextureGLTest::samplingSwizzle2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#elif !defined(MAGNUM_TARGET_WEBGL) +#endif + +#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingMaxLevel2D() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); @@ -1051,9 +1059,7 @@ void TextureGLTest::samplingBorderInteger2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#endif -#ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingDepthStencilMode2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -1117,6 +1123,7 @@ template void TextureGLTest::sampling3D() { MAGNUM_VERIFY_NO_GL_ERROR(); } +#ifndef MAGNUM_TARGET_WEBGL void TextureGLTest::samplingSrgbDecode3D() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current().isExtensionSupported()) @@ -1132,8 +1139,9 @@ void TextureGLTest::samplingSrgbDecode3D() { MAGNUM_VERIFY_NO_GL_ERROR(); } +#endif -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingSwizzle3D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -1145,7 +1153,9 @@ void TextureGLTest::samplingSwizzle3D() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#else +#endif + +#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingMaxLevel3D() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); @@ -1178,9 +1188,7 @@ void TextureGLTest::samplingBorderInteger3D() { MAGNUM_VERIFY_NO_GL_ERROR(); } -#endif -#ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingDepthStencilMode3D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -1197,7 +1205,7 @@ void TextureGLTest::samplingDepthStencilMode3D() { } #endif -#ifdef MAGNUM_TARGET_GLES +#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorder3D() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current().isExtensionSupported()) @@ -1247,7 +1255,7 @@ void TextureGLTest::storage2D() { MAGNUM_VERIFY_NO_GL_ERROR(); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifdef MAGNUM_TARGET_GLES if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing."); @@ -1276,7 +1284,7 @@ void TextureGLTest::storage3D() { MAGNUM_VERIFY_NO_GL_ERROR(); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifdef MAGNUM_TARGET_GLES if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing."); diff --git a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp index cd83daa6d..6ebefc105 100644 --- a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp @@ -49,7 +49,9 @@ struct TransformFeedbackGLTest: OpenGLTester { void constructMove(); void wrap(); + #ifndef MAGNUM_TARGET_WEBGL void label(); + #endif void attachBase(); void attachRange(); @@ -90,7 +92,9 @@ TransformFeedbackGLTest::TransformFeedbackGLTest() { &TransformFeedbackGLTest::constructMove, &TransformFeedbackGLTest::wrap, + #ifndef MAGNUM_TARGET_WEBGL &TransformFeedbackGLTest::label, + #endif &TransformFeedbackGLTest::attachBase, &TransformFeedbackGLTest::attachRange, @@ -170,6 +174,7 @@ void TransformFeedbackGLTest::wrap() { glDeleteTransformFeedbacks(1, &id); } +#ifndef MAGNUM_TARGET_WEBGL void TransformFeedbackGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ #ifndef MAGNUM_TARGET_GLES @@ -205,6 +210,7 @@ void TransformFeedbackGLTest::label() { MAGNUM_VERIFY_NO_GL_ERROR(); /* Check for errors again to flush the error state */ } } +#endif namespace { @@ -292,10 +298,14 @@ void TransformFeedbackGLTest::attachBase() { MAGNUM_VERIFY_NO_GL_ERROR(); + #ifdef MAGNUM_TARGET_WEBGL + CORRADE_SKIP("Can't map buffers on WebGL."); + #else auto data = Containers::arrayCast(output.mapRead(0, 2*sizeof(Vector2))); CORRADE_COMPARE(data[0], Vector2(1.0f, -1.0f)); CORRADE_COMPARE(data[1], Vector2(0.0f, 0.0f)); output.unmap(); + #endif } void TransformFeedbackGLTest::attachRange() { @@ -335,10 +345,14 @@ void TransformFeedbackGLTest::attachRange() { MAGNUM_VERIFY_NO_GL_ERROR(); + #ifdef MAGNUM_TARGET_WEBGL + CORRADE_SKIP("Can't map buffers on WebGL."); + #else auto data = Containers::arrayCast(output.mapRead(256, 2*sizeof(Vector2))); CORRADE_COMPARE(data[0], Vector2(1.0f, -1.0f)); CORRADE_COMPARE(data[1], Vector2(0.0f, 0.0f)); output.unmap(); + #endif } namespace { @@ -425,6 +439,9 @@ void TransformFeedbackGLTest::attachBases() { MAGNUM_VERIFY_NO_GL_ERROR(); + #ifdef MAGNUM_TARGET_WEBGL + CORRADE_SKIP("Can't map buffers on WebGL."); + #else auto data1 = Containers::arrayCast(output1.mapRead(0, 2*sizeof(Vector2))); CORRADE_COMPARE(data1[0], Vector2(1.0f, -1.0f)); CORRADE_COMPARE(data1[1], Vector2(0.0f, 0.0f)); @@ -434,6 +451,7 @@ void TransformFeedbackGLTest::attachBases() { CORRADE_COMPARE(data2[0], 0.0f); CORRADE_COMPARE(data2[1], -2.0f); output2.unmap(); + #endif } void TransformFeedbackGLTest::attachRanges() { @@ -477,6 +495,9 @@ void TransformFeedbackGLTest::attachRanges() { MAGNUM_VERIFY_NO_GL_ERROR(); + #ifdef MAGNUM_TARGET_WEBGL + CORRADE_SKIP("Can't map buffers on WebGL."); + #else auto data1 = Containers::arrayCast(output1.mapRead(256, 2*sizeof(Vector2))); CORRADE_COMPARE(data1[0], Vector2(1.0f, -1.0f)); CORRADE_COMPARE(data1[1], Vector2(0.0f, 0.0f)); @@ -486,6 +507,7 @@ void TransformFeedbackGLTest::attachRanges() { CORRADE_COMPARE(data2[0], 0.0f); CORRADE_COMPARE(data2[1], -2.0f); output2.unmap(); + #endif } #ifndef MAGNUM_TARGET_GLES