|
|
|
|
@ -36,121 +36,121 @@
|
|
|
|
|
|
|
|
|
|
namespace Magnum { namespace Test { |
|
|
|
|
|
|
|
|
|
class TextureGLTest: public AbstractOpenGLTester { |
|
|
|
|
class TextureArrayGLTest: public AbstractOpenGLTester { |
|
|
|
|
public: |
|
|
|
|
explicit TextureGLTest(); |
|
|
|
|
explicit TextureArrayGLTest(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void construct1DArray(); |
|
|
|
|
void construct1D(); |
|
|
|
|
#endif |
|
|
|
|
void construct2DArray(); |
|
|
|
|
void construct2D(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void sampling1DArray(); |
|
|
|
|
void sampling1D(); |
|
|
|
|
#endif |
|
|
|
|
void sampling2DArray(); |
|
|
|
|
void sampling2D(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void samplingBorderInteger1DArray(); |
|
|
|
|
void samplingBorderInteger2DArray(); |
|
|
|
|
void samplingBorderInteger1D(); |
|
|
|
|
void samplingBorderInteger2D(); |
|
|
|
|
#else |
|
|
|
|
void samplingBorder2DArray(); |
|
|
|
|
void samplingBorder2D(); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void storage1DArray(); |
|
|
|
|
void storage1D(); |
|
|
|
|
#endif |
|
|
|
|
void storage2DArray(); |
|
|
|
|
void storage2D(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void image1DArray(); |
|
|
|
|
void image1DArrayBuffer(); |
|
|
|
|
void image1D(); |
|
|
|
|
void image1DBuffer(); |
|
|
|
|
#endif |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
void image2DArray(); |
|
|
|
|
void image2DArrayBuffer(); |
|
|
|
|
void image2D(); |
|
|
|
|
void image2DBuffer(); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void subImage1DArray(); |
|
|
|
|
void subImage1DArrayBuffer(); |
|
|
|
|
void subImage1D(); |
|
|
|
|
void subImage1DBuffer(); |
|
|
|
|
#endif |
|
|
|
|
void subImage2DArray(); |
|
|
|
|
void subImage2DArrayBuffer(); |
|
|
|
|
void subImage2D(); |
|
|
|
|
void subImage2DBuffer(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void generateMipmap1DArray(); |
|
|
|
|
void generateMipmap1D(); |
|
|
|
|
#endif |
|
|
|
|
void generateMipmap2DArray(); |
|
|
|
|
void generateMipmap2D(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void invalidateImage1DArray(); |
|
|
|
|
void invalidateImage1D(); |
|
|
|
|
#endif |
|
|
|
|
void invalidateImage2DArray(); |
|
|
|
|
void invalidateImage2D(); |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void invalidateSubImage1DArray(); |
|
|
|
|
void invalidateSubImage1D(); |
|
|
|
|
#endif |
|
|
|
|
void invalidateSubImage2DArray(); |
|
|
|
|
void invalidateSubImage2D(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
TextureGLTest::TextureGLTest() { |
|
|
|
|
TextureArrayGLTest::TextureArrayGLTest() { |
|
|
|
|
addTests({ |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::construct1DArray, |
|
|
|
|
&TextureArrayGLTest::construct1D, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::construct2DArray, |
|
|
|
|
&TextureArrayGLTest::construct2D, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::sampling1DArray, |
|
|
|
|
&TextureArrayGLTest::sampling1D, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::sampling2DArray, |
|
|
|
|
&TextureArrayGLTest::sampling2D, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::samplingBorderInteger1DArray, |
|
|
|
|
&TextureGLTest::samplingBorderInteger2DArray, |
|
|
|
|
&TextureArrayGLTest::samplingBorderInteger1D, |
|
|
|
|
&TextureArrayGLTest::samplingBorderInteger2D, |
|
|
|
|
#else |
|
|
|
|
&TextureGLTest::samplingBorder2DArray, |
|
|
|
|
&TextureArrayGLTest::samplingBorder2D, |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::storage1DArray, |
|
|
|
|
&TextureArrayGLTest::storage1D, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::storage2DArray, |
|
|
|
|
&TextureArrayGLTest::storage2D, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::image1DArray, |
|
|
|
|
&TextureGLTest::image1DArrayBuffer, |
|
|
|
|
&TextureArrayGLTest::image1D, |
|
|
|
|
&TextureArrayGLTest::image1DBuffer, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::image2DArray, |
|
|
|
|
&TextureGLTest::image2DArrayBuffer, |
|
|
|
|
&TextureArrayGLTest::image2D, |
|
|
|
|
&TextureArrayGLTest::image2DBuffer, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::subImage1DArray, |
|
|
|
|
&TextureGLTest::subImage1DArrayBuffer, |
|
|
|
|
&TextureArrayGLTest::subImage1D, |
|
|
|
|
&TextureArrayGLTest::subImage1DBuffer, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::subImage2DArray, |
|
|
|
|
&TextureGLTest::subImage2DArrayBuffer, |
|
|
|
|
&TextureArrayGLTest::subImage2D, |
|
|
|
|
&TextureArrayGLTest::subImage2DBuffer, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::generateMipmap1DArray, |
|
|
|
|
&TextureArrayGLTest::generateMipmap1D, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::generateMipmap2DArray, |
|
|
|
|
&TextureArrayGLTest::generateMipmap2D, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::invalidateImage1DArray, |
|
|
|
|
&TextureArrayGLTest::invalidateImage1D, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::invalidateImage2DArray, |
|
|
|
|
&TextureArrayGLTest::invalidateImage2D, |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
&TextureGLTest::invalidateSubImage1DArray, |
|
|
|
|
&TextureArrayGLTest::invalidateSubImage1D, |
|
|
|
|
#endif |
|
|
|
|
&TextureGLTest::invalidateSubImage2DArray |
|
|
|
|
&TextureArrayGLTest::invalidateSubImage2D |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::construct1DArray() { |
|
|
|
|
void TextureArrayGLTest::construct1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -165,7 +165,7 @@ void TextureGLTest::construct1DArray() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::construct2DArray() { |
|
|
|
|
void TextureArrayGLTest::construct2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -182,7 +182,7 @@ void TextureGLTest::construct2DArray() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::sampling1DArray() { |
|
|
|
|
void TextureArrayGLTest::sampling1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -196,7 +196,7 @@ void TextureGLTest::sampling1DArray() {
|
|
|
|
|
MAGNUM_VERIFY_NO_ERROR(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TextureGLTest::samplingBorderInteger1DArray() { |
|
|
|
|
void TextureArrayGLTest::samplingBorderInteger1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -211,7 +211,7 @@ void TextureGLTest::samplingBorderInteger1DArray() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::sampling2DArray() { |
|
|
|
|
void TextureArrayGLTest::sampling2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -232,7 +232,7 @@ void TextureGLTest::sampling2DArray() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::samplingBorderInteger2DArray() { |
|
|
|
|
void TextureArrayGLTest::samplingBorderInteger2D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -246,7 +246,7 @@ void TextureGLTest::samplingBorderInteger2DArray() {
|
|
|
|
|
MAGNUM_VERIFY_NO_ERROR(); |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
void TextureGLTest::samplingBorder2DArray() { |
|
|
|
|
void TextureArrayGLTest::samplingBorder2D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::texture_border_clamp>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::NV::texture_border_clamp::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -259,7 +259,7 @@ void TextureGLTest::samplingBorder2DArray() {
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::storage1DArray() { |
|
|
|
|
void TextureArrayGLTest::storage1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -279,7 +279,7 @@ void TextureGLTest::storage1DArray() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::storage2DArray() { |
|
|
|
|
void TextureArrayGLTest::storage2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -304,7 +304,7 @@ void TextureGLTest::storage2DArray() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::image1DArray() { |
|
|
|
|
void TextureArrayGLTest::image1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -328,7 +328,7 @@ void TextureGLTest::image1DArray() {
|
|
|
|
|
std::vector<UnsignedByte>(data, data + 16), TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TextureGLTest::image1DArrayBuffer() { |
|
|
|
|
void TextureArrayGLTest::image1DBuffer() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -354,7 +354,7 @@ void TextureGLTest::image1DArrayBuffer() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::image2DArray() { |
|
|
|
|
void TextureArrayGLTest::image2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -387,7 +387,7 @@ void TextureGLTest::image2DArray() {
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TextureGLTest::image2DArrayBuffer() { |
|
|
|
|
void TextureArrayGLTest::image2DBuffer() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -422,7 +422,7 @@ void TextureGLTest::image2DArrayBuffer() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::subImage1DArray() { |
|
|
|
|
void TextureArrayGLTest::subImage1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -453,7 +453,7 @@ void TextureGLTest::subImage1DArray() {
|
|
|
|
|
}), TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TextureGLTest::subImage1DArrayBuffer() { |
|
|
|
|
void TextureArrayGLTest::subImage1DBuffer() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -486,7 +486,7 @@ void TextureGLTest::subImage1DArrayBuffer() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::subImage2DArray() { |
|
|
|
|
void TextureArrayGLTest::subImage2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -541,7 +541,7 @@ void TextureGLTest::subImage2DArray() {
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TextureGLTest::subImage2DArrayBuffer() { |
|
|
|
|
void TextureArrayGLTest::subImage2DBuffer() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -598,7 +598,7 @@ void TextureGLTest::subImage2DArrayBuffer() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::generateMipmap1DArray() { |
|
|
|
|
void TextureArrayGLTest::generateMipmap1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
@ -626,7 +626,7 @@ void TextureGLTest::generateMipmap1DArray() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::generateMipmap2DArray() { |
|
|
|
|
void TextureArrayGLTest::generateMipmap2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); |
|
|
|
|
@ -661,7 +661,7 @@ void TextureGLTest::generateMipmap2DArray() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::invalidateImage1DArray() { |
|
|
|
|
void TextureArrayGLTest::invalidateImage1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -673,7 +673,7 @@ void TextureGLTest::invalidateImage1DArray() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::invalidateImage2DArray() { |
|
|
|
|
void TextureArrayGLTest::invalidateImage2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -687,7 +687,7 @@ void TextureGLTest::invalidateImage2DArray() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
void TextureGLTest::invalidateSubImage1DArray() { |
|
|
|
|
void TextureArrayGLTest::invalidateSubImage1D() { |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
|
|
|
|
|
@ -699,7 +699,7 @@ void TextureGLTest::invalidateSubImage1DArray() {
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void TextureGLTest::invalidateSubImage2DArray() { |
|
|
|
|
void TextureArrayGLTest::invalidateSubImage2D() { |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>()) |
|
|
|
|
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); |
|
|
|
|
@ -714,4 +714,4 @@ void TextureGLTest::invalidateSubImage2DArray() {
|
|
|
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
|
|
CORRADE_TEST_MAIN(Magnum::Test::TextureGLTest) |
|
|
|
|
CORRADE_TEST_MAIN(Magnum::Test::TextureArrayGLTest) |
|
|
|
|
|