Browse Source

Properly test border sampling for cube map textures on ES.

Not sure why I did not do that. The NV_texture_border_clamp extension
does not mention any restriction to 2D/3D textures.
pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
7891f33bab
  1. 23
      src/Magnum/Test/CubeMapTextureGLTest.cpp

23
src/Magnum/Test/CubeMapTextureGLTest.cpp

@ -62,6 +62,9 @@ struct CubeMapTextureGLTest: AbstractOpenGLTester {
#ifndef MAGNUM_TARGET_GLES2
void samplingDepthStencilMode();
#endif
#ifdef MAGNUM_TARGET_GLES
void samplingBorder();
#endif
void storage();
@ -110,6 +113,9 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() {
#ifndef MAGNUM_TARGET_GLES2
&CubeMapTextureGLTest::samplingDepthStencilMode,
#endif
#ifdef MAGNUM_TARGET_GLES
&CubeMapTextureGLTest::samplingBorder,
#endif
&CubeMapTextureGLTest::storage,
@ -206,8 +212,12 @@ void CubeMapTextureGLTest::sampling() {
.setBaseLevel(1)
.setMaxLevel(750)
#endif
#ifndef MAGNUM_TARGET_GLES
.setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f))
#else
.setWrapping(Sampler::Wrapping::ClampToEdge)
#endif
.setMaxAnisotropy(Sampler::maxMaxAnisotropy())
#ifndef MAGNUM_TARGET_GLES2
.setCompareMode(Sampler::CompareMode::CompareRefToTexture)
@ -301,6 +311,19 @@ void CubeMapTextureGLTest::samplingDepthStencilMode() {
}
#endif
#ifdef MAGNUM_TARGET_GLES
void CubeMapTextureGLTest::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."));
CubeMapTexture texture;
texture.setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f));
MAGNUM_VERIFY_NO_ERROR();
}
#endif
void CubeMapTextureGLTest::storage() {
CubeMapTexture texture;
texture.setStorage(5, TextureFormat::RGBA8, Vector2i(32));

Loading…
Cancel
Save