Browse Source

Verify that *Texture::bind() doesn't emit any GL errors.

Can't verify much more at this time.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
2696397021
  1. 12
      src/Magnum/Test/BufferTextureGLTest.cpp
  2. 9
      src/Magnum/Test/CubeMapTextureArrayGLTest.cpp
  3. 9
      src/Magnum/Test/CubeMapTextureGLTest.cpp
  4. 26
      src/Magnum/Test/MultisampleTextureGLTest.cpp
  5. 12
      src/Magnum/Test/RectangleTextureGLTest.cpp
  6. 34
      src/Magnum/Test/TextureArrayGLTest.cpp
  7. 40
      src/Magnum/Test/TextureGLTest.cpp

12
src/Magnum/Test/BufferTextureGLTest.cpp

@ -36,12 +36,14 @@ class BufferTextureGLTest: public AbstractOpenGLTester {
explicit BufferTextureGLTest();
void construct();
void bind();
void setBuffer();
void setBufferOffset();
};
BufferTextureGLTest::BufferTextureGLTest() {
addTests({&BufferTextureGLTest::construct,
&BufferTextureGLTest::bind,
&BufferTextureGLTest::setBuffer,
&BufferTextureGLTest::setBufferOffset});
}
@ -60,6 +62,16 @@ void BufferTextureGLTest::construct() {
MAGNUM_VERIFY_NO_ERROR();
}
void BufferTextureGLTest::bind() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));
BufferTexture texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void BufferTextureGLTest::setBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));

9
src/Magnum/Test/CubeMapTextureArrayGLTest.cpp

@ -40,6 +40,7 @@ class CubeMapTextureArrayGLTest: public AbstractOpenGLTester {
explicit CubeMapTextureArrayGLTest();
void construct();
void bind();
void sampling();
void samplingBorderInteger();
@ -59,6 +60,7 @@ class CubeMapTextureArrayGLTest: public AbstractOpenGLTester {
CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() {
addTests({&CubeMapTextureArrayGLTest::construct,
&CubeMapTextureArrayGLTest::bind,
&CubeMapTextureArrayGLTest::sampling,
&CubeMapTextureArrayGLTest::samplingBorderInteger,
@ -90,6 +92,13 @@ void CubeMapTextureArrayGLTest::construct() {
MAGNUM_VERIFY_NO_ERROR();
}
void CubeMapTextureArrayGLTest::bind() {
CubeMapTextureArray texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void CubeMapTextureArrayGLTest::sampling() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));

9
src/Magnum/Test/CubeMapTextureGLTest.cpp

@ -43,6 +43,7 @@ class CubeMapTextureGLTest: public AbstractOpenGLTester {
explicit CubeMapTextureGLTest();
void construct();
void bind();
void sampling();
#ifdef MAGNUM_TARGET_GLES2
@ -72,6 +73,7 @@ class CubeMapTextureGLTest: public AbstractOpenGLTester {
CubeMapTextureGLTest::CubeMapTextureGLTest() {
addTests({&CubeMapTextureGLTest::construct,
&CubeMapTextureGLTest::bind,
&CubeMapTextureGLTest::sampling,
#ifdef MAGNUM_TARGET_GLES2
@ -110,6 +112,13 @@ void CubeMapTextureGLTest::construct() {
MAGNUM_VERIFY_NO_ERROR();
}
void CubeMapTextureGLTest::bind() {
CubeMapTexture texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void CubeMapTextureGLTest::sampling() {
CubeMapTexture texture;
texture.setMinificationFilter(Sampler::Filter::Linear, Sampler::Mipmap::Linear)

26
src/Magnum/Test/MultisampleTextureGLTest.cpp

@ -37,6 +37,9 @@ class MultisampleTextureGLTest: public AbstractOpenGLTester {
void construct2D();
void construct2DArray();
void bind2D();
void bind2DArray();
void storage2D();
void storage2DArray();
@ -61,6 +64,9 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() {
addTests({&MultisampleTextureGLTest::construct2D,
&MultisampleTextureGLTest::construct2DArray,
&MultisampleTextureGLTest::bind2D,
&MultisampleTextureGLTest::bind2DArray,
&MultisampleTextureGLTest::storage2D,
&MultisampleTextureGLTest::storage2DArray,
@ -109,6 +115,26 @@ void MultisampleTextureGLTest::construct2DArray() {
MAGNUM_VERIFY_NO_ERROR();
}
void MultisampleTextureGLTest::bind2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
MultisampleTexture2D texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void MultisampleTextureGLTest::bind2DArray() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
MultisampleTexture2DArray texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void MultisampleTextureGLTest::storage2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));

12
src/Magnum/Test/RectangleTextureGLTest.cpp

@ -41,6 +41,7 @@ class RectangleTextureGLTest: public AbstractOpenGLTester {
explicit RectangleTextureGLTest();
void construct();
void bind();
void sampling();
void samplingBorderInteger();
@ -58,6 +59,7 @@ class RectangleTextureGLTest: public AbstractOpenGLTester {
RectangleTextureGLTest::RectangleTextureGLTest() {
addTests({&RectangleTextureGLTest::construct,
&RectangleTextureGLTest::bind,
&RectangleTextureGLTest::sampling,
&RectangleTextureGLTest::samplingBorderInteger,
@ -88,6 +90,16 @@ void RectangleTextureGLTest::construct() {
MAGNUM_VERIFY_NO_ERROR();
}
void RectangleTextureGLTest::bind() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void RectangleTextureGLTest::sampling() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));

34
src/Magnum/Test/TextureArrayGLTest.cpp

@ -45,6 +45,11 @@ class TextureArrayGLTest: public AbstractOpenGLTester {
#endif
void construct2D();
#ifndef MAGNUM_TARGET_GLES
void bind1D();
#endif
void bind2D();
#ifndef MAGNUM_TARGET_GLES
void sampling1D();
#endif
@ -105,6 +110,11 @@ TextureArrayGLTest::TextureArrayGLTest() {
#endif
&TextureArrayGLTest::construct2D,
#ifndef MAGNUM_TARGET_GLES
&TextureArrayGLTest::bind1D,
#endif
&TextureArrayGLTest::bind2D,
#ifndef MAGNUM_TARGET_GLES
&TextureArrayGLTest::sampling1D,
#endif
@ -189,6 +199,30 @@ void TextureArrayGLTest::construct2D() {
MAGNUM_VERIFY_NO_ERROR();
}
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::bind1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
#endif
void TextureArrayGLTest::bind2D() {
#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."));
#endif
Texture2DArray texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::sampling1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())

40
src/Magnum/Test/TextureGLTest.cpp

@ -48,6 +48,12 @@ class TextureGLTest: public AbstractOpenGLTester {
void construct2D();
void construct3D();
#ifndef MAGNUM_TARGET_GLES
void bind1D();
#endif
void bind2D();
void bind3D();
#ifndef MAGNUM_TARGET_GLES
void sampling1D();
#endif
@ -128,6 +134,12 @@ TextureGLTest::TextureGLTest() {
&TextureGLTest::construct2D,
&TextureGLTest::construct3D,
#ifndef MAGNUM_TARGET_GLES
&TextureGLTest::bind1D,
#endif
&TextureGLTest::bind2D,
&TextureGLTest::bind3D,
#ifndef MAGNUM_TARGET_GLES
&TextureGLTest::sampling1D,
#endif
@ -239,6 +251,34 @@ void TextureGLTest::construct3D() {
MAGNUM_VERIFY_NO_ERROR();
}
#ifndef MAGNUM_TARGET_GLES
void TextureGLTest::bind1D() {
Texture1D texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
#endif
void TextureGLTest::bind2D() {
Texture2D texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
void TextureGLTest::bind3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
Texture3D texture;
texture.bind(15);
MAGNUM_VERIFY_NO_ERROR();
}
#ifndef MAGNUM_TARGET_GLES
void TextureGLTest::sampling1D() {
Texture1D texture;

Loading…
Cancel
Save