@ -25,23 +25,23 @@
# include <Corrade/TestSuite/Compare/Container.h>
# include <Corrade/TestSuite/Compare/Container.h>
# include "Magnum/Context.h"
# include "Magnum/Image.h"
# include "Magnum/Extensions.h"
# include "Magnum/GL/Context.h"
# include "Magnum/GL/Extensions.h"
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
# include "Magnum/BufferImage.h"
# include "Magnum/GL/ BufferImage.h"
# endif
# endif
# include "Magnum/CubeMapTexture.h"
# include "Magnum/GL/CubeMapTexture.h"
# include "Magnum/Image.h"
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# include "Magnum/ImageFormat.h"
# include "Magnum/GL/ ImageFormat.h"
# endif
# endif
# include "Magnum/OpenGLTester.h"
# include "Magnum/GL/ OpenGLTester.h"
# include "Magnum/PixelFormat.h"
# include "Magnum/GL/ PixelFormat.h"
# include "Magnum/TextureFormat.h"
# include "Magnum/GL/ TextureFormat.h"
# include "Magnum/Math/Color.h"
# include "Magnum/Math/Color.h"
# include "Magnum/Math/Range.h"
# include "Magnum/Math/Range.h"
namespace Magnum { namespace Test {
namespace Magnum { namespace GL { namespace Test {
struct CubeMapTextureGLTest : OpenGLTester {
struct CubeMapTextureGLTest : OpenGLTester {
explicit CubeMapTextureGLTest ( ) ;
explicit CubeMapTextureGLTest ( ) ;
@ -389,11 +389,11 @@ void CubeMapTextureGLTest::construct() {
{
{
CubeMapTexture texture ;
CubeMapTexture texture ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_VERIFY ( texture . id ( ) > 0 ) ;
CORRADE_VERIFY ( texture . id ( ) > 0 ) ;
}
}
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
void CubeMapTextureGLTest : : wrap ( ) {
void CubeMapTextureGLTest : : wrap ( ) {
@ -415,26 +415,26 @@ void CubeMapTextureGLTest::bind() {
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . bind ( 15 ) ;
texture . bind ( 15 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
AbstractTexture : : unbind ( 15 ) ;
AbstractTexture : : unbind ( 15 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
AbstractTexture : : bind ( 7 , { & texture , nullptr , & texture } ) ;
AbstractTexture : : bind ( 7 , { & texture , nullptr , & texture } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
AbstractTexture : : unbind ( 7 , 3 ) ;
AbstractTexture : : unbind ( 7 , 3 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void CubeMapTextureGLTest : : bindImage ( ) {
void CubeMapTextureGLTest : : bindImage ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : shader_image_load_store > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : shader_image_load_store > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : shader_image_load_store : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : shader_image_load_store : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
CORRADE_SKIP ( " OpenGL ES 3.1 is not supported. " ) ;
CORRADE_SKIP ( " OpenGL ES 3.1 is not supported. " ) ;
@ -444,23 +444,23 @@ void CubeMapTextureGLTest::bindImage() {
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 32 } )
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 32 } )
. bindImage ( 2 , 0 , CubeMapCoordinate : : NegativeX , ImageAccess : : ReadWrite , ImageFormat : : RGBA8 ) ;
. bindImage ( 2 , 0 , CubeMapCoordinate : : NegativeX , ImageAccess : : ReadWrite , ImageFormat : : RGBA8 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
texture . bindImageLayered ( 3 , 0 , ImageAccess : : ReadWrite , ImageFormat : : RGBA8 ) ;
texture . bindImageLayered ( 3 , 0 , ImageAccess : : ReadWrite , ImageFormat : : RGBA8 ) ;
AbstractTexture : : unbindImage ( 2 ) ;
AbstractTexture : : unbindImage ( 2 ) ;
AbstractTexture : : unbindImage ( 3 ) ;
AbstractTexture : : unbindImage ( 3 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
AbstractTexture : : bindImages ( 1 , { & texture , nullptr , & texture } ) ;
AbstractTexture : : bindImages ( 1 , { & texture , nullptr , & texture } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
AbstractTexture : : unbindImages ( 1 , 3 ) ;
AbstractTexture : : unbindImages ( 1 , 3 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# endif
# endif
}
}
# endif
# endif
@ -489,115 +489,115 @@ template<class T> void CubeMapTextureGLTest::sampling() {
# endif
# endif
. setMaxAnisotropy ( Sampler : : maxMaxAnisotropy ( ) )
. setMaxAnisotropy ( Sampler : : maxMaxAnisotropy ( ) )
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
. setCompareMode ( Sampler : : CompareMode : : CompareRefToTexture )
. setCompareMode ( SamplerCompareMode : : CompareRefToTexture )
. setCompareFunction ( Sampler : : CompareFunction : : GreaterOrEqual )
. setCompareFunction ( SamplerCompareFunction : : GreaterOrEqual )
# endif
# endif
;
;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
void CubeMapTextureGLTest : : samplingSRGBDecode ( ) {
void CubeMapTextureGLTest : : samplingSRGBDecode ( ) {
# ifdef MAGNUM_TARGET_GLES2
# ifdef MAGNUM_TARGET_GLES2
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : sRGB > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : sRGB > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : sRGB : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : sRGB : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_sRGB_decode > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_sRGB_decode > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_sRGB_decode : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_sRGB_decode : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setSRGBDecode ( false ) ;
texture . setSRGBDecode ( false ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void CubeMapTextureGLTest : : samplingSwizzle ( ) {
void CubeMapTextureGLTest : : samplingSwizzle ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : texture_swizzle > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : texture_swizzle > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : texture_swizzle : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : texture_swizzle : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setSwizzle < ' b ' , ' g ' , ' r ' , ' 0 ' > ( ) ;
texture . setSwizzle < ' b ' , ' g ' , ' r ' , ' 0 ' > ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# elif !defined(MAGNUM_TARGET_WEBGL)
# elif !defined(MAGNUM_TARGET_WEBGL)
void CubeMapTextureGLTest : : samplingMaxLevel ( ) {
void CubeMapTextureGLTest : : samplingMaxLevel ( ) {
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : APPLE : : texture_max_level > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : APPLE : : texture_max_level > ( ) )
CORRADE_SKIP ( Extensions : : GL : : APPLE : : texture_max_level : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : APPLE : : texture_max_level : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setMaxLevel ( 750 ) ;
texture . setMaxLevel ( 750 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
void CubeMapTextureGLTest : : samplingCompare ( ) {
void CubeMapTextureGLTest : : samplingCompare ( ) {
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : shadow_samplers > ( ) | |
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : shadow_samplers > ( ) | |
! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : NV : : shadow_samplers_cube > ( ) )
! Context : : current ( ) . isExtensionSupported < Extensions : : NV : : shadow_samplers_cube > ( ) )
CORRADE_SKIP ( Extensions : : GL : : NV : : shadow_samplers_cube : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : NV : : shadow_samplers_cube : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setCompareMode ( Sampler : : CompareMode : : CompareRefToTexture )
texture . setCompareMode ( SamplerCompareMode : : CompareRefToTexture )
. setCompareFunction ( Sampler : : CompareFunction : : GreaterOrEqual ) ;
. setCompareFunction ( SamplerCompareFunction : : GreaterOrEqual ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void CubeMapTextureGLTest : : samplingBorderInteger ( ) {
void CubeMapTextureGLTest : : samplingBorderInteger ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_integer > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_integer > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_integer : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_integer : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_border_clamp > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_border_clamp > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_border_clamp : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_border_clamp : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
CubeMapTexture a ;
CubeMapTexture a ;
a . setWrapping ( Sampler : : Wrapping : : ClampToBorder )
a . setWrapping ( SamplerWrapping : : ClampToBorder )
. setBorderColor ( Vector4i ( 1 , 56 , 78 , - 2 ) ) ;
. setBorderColor ( Vector4i ( 1 , 56 , 78 , - 2 ) ) ;
CubeMapTexture b ;
CubeMapTexture b ;
b . setWrapping ( Sampler : : Wrapping : : ClampToBorder )
b . setWrapping ( SamplerWrapping : : ClampToBorder )
. setBorderColor ( Vector4ui ( 35 , 56 , 78 , 15 ) ) ;
. setBorderColor ( Vector4ui ( 35 , 56 , 78 , 15 ) ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void CubeMapTextureGLTest : : samplingDepthStencilMode ( ) {
void CubeMapTextureGLTest : : samplingDepthStencilMode ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : stencil_texturing > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : stencil_texturing > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : stencil_texturing : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : stencil_texturing : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
CORRADE_SKIP ( " OpenGL ES 3.1 not supported. " ) ;
CORRADE_SKIP ( " OpenGL ES 3.1 not supported. " ) ;
# endif
# endif
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setDepthStencilMode ( Sampler : : DepthStencilMode : : StencilIndex ) ;
texture . setDepthStencilMode ( SamplerDepthStencilMode : : StencilIndex ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# endif
# endif
# if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
# if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
void CubeMapTextureGLTest : : samplingBorder ( ) {
void CubeMapTextureGLTest : : samplingBorder ( ) {
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : NV : : texture_border_clamp > ( ) & &
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : NV : : texture_border_clamp > ( ) & &
! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_border_clamp > ( ) )
! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_border_clamp > ( ) )
CORRADE_SKIP ( " No required extension is supported. " ) ;
CORRADE_SKIP ( " No required extension is supported. " ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setWrapping ( Sampler : : Wrapping : : ClampToBorder )
texture . setWrapping ( SamplerWrapping : : ClampToBorder )
. setBorderColor ( Color3 ( 0.5f ) ) ;
. setBorderColor ( Color3 ( 0.5f ) ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
# endif
# endif
@ -611,7 +611,7 @@ void CubeMapTextureGLTest::storage() {
# endif
# endif
Vector2i ( 32 ) ) ;
Vector2i ( 32 ) ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
# ifdef MAGNUM_TARGET_GLES
# ifdef MAGNUM_TARGET_GLES
@ -627,7 +627,7 @@ void CubeMapTextureGLTest::storage() {
/* Not available */
/* Not available */
CORRADE_COMPARE ( texture . imageSize ( 5 ) , Vector2i ( 0 ) ) ;
CORRADE_COMPARE ( texture . imageSize ( 5 ) , Vector2i ( 0 ) ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# endif
# endif
}
}
@ -640,8 +640,8 @@ void CubeMapTextureGLTest::image() {
# ifdef MAGNUM_TARGET_GLES2
# ifdef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : unpack_subimage > ( ) )
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : unpack_subimage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : unpack_subimage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : unpack_subimage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } )
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } )
CORRADE_SKIP ( " Image unpack is not supported in WebGL 1. " ) ;
CORRADE_SKIP ( " Image unpack is not supported in WebGL 1. " ) ;
@ -669,7 +669,7 @@ void CubeMapTextureGLTest::image() {
texture . setImage ( CubeMapCoordinate : : NegativeZ , 0 , format ,
texture . setImage ( CubeMapCoordinate : : NegativeZ , 0 , format ,
ImageView2D { PixelFormat : : RGBA , PixelType : : UnsignedByte , Vector2i ( 2 ) , Zero } ) ;
ImageView2D { PixelFormat : : RGBA , PixelType : : UnsignedByte , Vector2i ( 2 ) , Zero } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
/** @todo How to test this on ES? */
/** @todo How to test this on ES? */
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
@ -677,7 +677,7 @@ void CubeMapTextureGLTest::image() {
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage ,
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage ,
PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 2 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 2 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -707,7 +707,7 @@ void CubeMapTextureGLTest::imageBuffer() {
texture . setImage ( CubeMapCoordinate : : NegativeZ , 0 , TextureFormat : : RGBA8 ,
texture . setImage ( CubeMapCoordinate : : NegativeZ , 0 , TextureFormat : : RGBA8 ,
ImageView2D { PixelFormat : : RGBA , PixelType : : UnsignedByte , Vector2i ( 2 ) , Zero } ) ;
ImageView2D { PixelFormat : : RGBA , PixelType : : UnsignedByte , Vector2i ( 2 ) , Zero } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
/** @todo How to test this on ES? */
/** @todo How to test this on ES? */
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
@ -715,7 +715,7 @@ void CubeMapTextureGLTest::imageBuffer() {
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage , PixelFormat : : RGBA , PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage , PixelFormat : : RGBA , PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 2 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 2 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -741,8 +741,8 @@ void CubeMapTextureGLTest::subImage() {
# ifdef MAGNUM_TARGET_GLES2
# ifdef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : unpack_subimage > ( ) )
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : unpack_subimage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : unpack_subimage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : unpack_subimage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } )
if ( PixelStorageData [ testCaseInstanceId ( ) ] . storage ! = PixelStorage { } )
CORRADE_SKIP ( " Image unpack is not supported in WebGL 1. " ) ;
CORRADE_SKIP ( " Image unpack is not supported in WebGL 1. " ) ;
@ -773,13 +773,13 @@ void CubeMapTextureGLTest::subImage() {
PixelFormat : : RGBA , PixelType : : UnsignedByte , Vector2i ( 2 ) ,
PixelFormat : : RGBA , PixelType : : UnsignedByte , Vector2i ( 2 ) ,
PixelStorageData [ testCaseInstanceId ( ) ] . dataSparse } ) ;
PixelStorageData [ testCaseInstanceId ( ) ] . dataSparse } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
/** @todo How to test this on ES? */
/** @todo How to test this on ES? */
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
Image2D image = texture . image ( CubeMapCoordinate : : PositiveX , 0 , { PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
Image2D image = texture . image ( CubeMapCoordinate : : PositiveX , 0 , { PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 4 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 4 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) ,
@ -810,14 +810,14 @@ void CubeMapTextureGLTest::subImageBuffer() {
PixelStorageData [ testCaseInstanceId ( ) ] . dataSparse ,
PixelStorageData [ testCaseInstanceId ( ) ] . dataSparse ,
BufferUsage : : StaticDraw } ) ;
BufferUsage : : StaticDraw } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
/** @todo How to test this on ES? */
/** @todo How to test this on ES? */
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
BufferImage2D image = texture . image ( CubeMapCoordinate : : PositiveX , 0 , { PixelFormat : : RGBA , PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
BufferImage2D image = texture . image ( CubeMapCoordinate : : PositiveX , 0 , { PixelFormat : : RGBA , PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 4 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i ( 4 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) ,
@ -831,23 +831,23 @@ void CubeMapTextureGLTest::subImageBuffer() {
void CubeMapTextureGLTest : : subImageQuery ( ) {
void CubeMapTextureGLTest : : subImageQuery ( ) {
setTestCaseDescription ( PixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( PixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : get_texture_sub_image > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : get_texture_sub_image > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
/* I'm too lazy to call setSubImage() six times */
/* I'm too lazy to call setSubImage() six times */
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 4 } )
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 4 } )
. setSubImage ( 0 , { } , ImageView3D { PixelFormat : : RGBA , PixelType : : UnsignedByte , { 4 , 4 , 1 } , SubDataComplete } ) ;
. setSubImage ( 0 , { } , ImageView3D { PixelFormat : : RGBA , PixelType : : UnsignedByte , { 4 , 4 , 1 } , SubDataComplete } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
Image3D image = texture . subImage ( 0 , Range3Di : : fromSize ( { 1 , 1 , 0 } , { 2 , 2 , 1 } ) ,
Image3D image = texture . subImage ( 0 , Range3Di : : fromSize ( { 1 , 1 , 0 } , { 2 , 2 , 1 } ) ,
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage ,
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage ,
PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 1 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 1 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < const UnsignedByte > ( image . data ( ) ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < const UnsignedByte > ( image . data ( ) ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -858,24 +858,24 @@ void CubeMapTextureGLTest::subImageQuery() {
void CubeMapTextureGLTest : : subImageQueryBuffer ( ) {
void CubeMapTextureGLTest : : subImageQueryBuffer ( ) {
setTestCaseDescription ( PixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( PixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : get_texture_sub_image > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : get_texture_sub_image > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
/* I'm too lazy to call setSubImage() six times */
/* I'm too lazy to call setSubImage() six times */
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 4 } )
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 4 } )
. setSubImage ( 0 , { } , ImageView3D { PixelFormat : : RGBA , PixelType : : UnsignedByte , { 4 , 4 , 1 } , SubDataComplete } ) ;
. setSubImage ( 0 , { } , ImageView3D { PixelFormat : : RGBA , PixelType : : UnsignedByte , { 4 , 4 , 1 } , SubDataComplete } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
BufferImage3D image = texture . subImage ( 0 , Range3Di : : fromSize ( { 1 , 1 , 0 } , { 2 , 2 , 1 } ) ,
BufferImage3D image = texture . subImage ( 0 , Range3Di : : fromSize ( { 1 , 1 , 0 } , { 2 , 2 , 1 } ) ,
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage ,
{ PixelStorageData [ testCaseInstanceId ( ) ] . storage ,
PixelFormat : : RGBA , PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
PixelFormat : : RGBA , PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 1 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 1 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) . suffix ( PixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -888,16 +888,16 @@ void CubeMapTextureGLTest::compressedImage() {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : WEBGL : : compressed_texture_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : WEBGL : : compressed_texture_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
const CompressedImageView2D view {
const CompressedImageView2D view {
@ -915,12 +915,12 @@ void CubeMapTextureGLTest::compressedImage() {
. setCompressedImage ( CubeMapCoordinate : : PositiveZ , 0 , view )
. setCompressedImage ( CubeMapCoordinate : : PositiveZ , 0 , view )
. setCompressedImage ( CubeMapCoordinate : : NegativeZ , 0 , view ) ;
. setCompressedImage ( CubeMapCoordinate : : NegativeZ , 0 , view ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
CompressedImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
CompressedImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 4 } ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 4 } ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -934,16 +934,16 @@ void CubeMapTextureGLTest::compressedImageBuffer() {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : WEBGL : : compressed_texture_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : WEBGL : : compressed_texture_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
CompressedBufferImage2D buffer {
CompressedBufferImage2D buffer {
@ -962,14 +962,14 @@ void CubeMapTextureGLTest::compressedImageBuffer() {
. setCompressedImage ( CubeMapCoordinate : : PositiveZ , 0 , buffer )
. setCompressedImage ( CubeMapCoordinate : : PositiveZ , 0 , buffer )
. setCompressedImage ( CubeMapCoordinate : : NegativeZ , 0 , buffer ) ;
. setCompressedImage ( CubeMapCoordinate : : NegativeZ , 0 , buffer ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
CompressedBufferImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 ,
CompressedBufferImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 ,
{ CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } , BufferUsage : : StaticRead ) ;
{ CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } , BufferUsage : : StaticRead ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 4 } ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 4 } ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -984,18 +984,18 @@ void CubeMapTextureGLTest::immutableCompressedImage() {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : texture_storage > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : texture_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : texture_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : texture_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# elif defined(MAGNUM_TARGET_GLES2)
# elif defined(MAGNUM_TARGET_GLES2)
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_storage > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
/* Testing that GL_TEXTURE_COMPRESSED_IMAGE_SIZE is consistent and returns
/* Testing that GL_TEXTURE_COMPRESSED_IMAGE_SIZE is consistent and returns
@ -1021,12 +1021,12 @@ void CubeMapTextureGLTest::immutableCompressedImage() {
. setCompressedSubImage ( CubeMapCoordinate : : PositiveZ , 0 , { } , view )
. setCompressedSubImage ( CubeMapCoordinate : : PositiveZ , 0 , { } , view )
. setCompressedSubImage ( CubeMapCoordinate : : NegativeZ , 0 , { } , view ) ;
. setCompressedSubImage ( CubeMapCoordinate : : NegativeZ , 0 , { } , view ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
CompressedImage2D image = texture . compressedImage ( CubeMapCoordinate : : NegativeY , 0 , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
CompressedImage2D image = texture . compressedImage ( CubeMapCoordinate : : NegativeY , 0 , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 4 } ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 4 } ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -1071,16 +1071,16 @@ void CubeMapTextureGLTest::compressedSubImage() {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : WEBGL : : compressed_texture_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : WEBGL : : compressed_texture_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
CubeMapTexture texture ;
CubeMapTexture texture ;
@ -1103,17 +1103,17 @@ void CubeMapTextureGLTest::compressedSubImage() {
CompressedPixelFormat : : RGBAS3tcDxt3 , Vector2i { 4 } ,
CompressedPixelFormat : : RGBAS3tcDxt3 , Vector2i { 4 } ,
CompressedPixelStorageData [ testCaseInstanceId ( ) ] . dataSparse } ) ;
CompressedPixelStorageData [ testCaseInstanceId ( ) ] . dataSparse } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
CompressedImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 , { } ) ;
CompressedImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 , { } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 12 } ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 12 } ) ;
{
{
CORRADE_EXPECT_FAIL_IF ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) & & ( Context : : current ( ) . detectedDriver ( ) & Context : : DetectedDriver : : NVidia ) ,
CORRADE_EXPECT_FAIL_IF ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) & & ( Context : : current ( ) . detectedDriver ( ) & Context : : DetectedDriver : : NVidia ) ,
" Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images when using ARB_direct_state_access " ) ;
" Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images when using ARB_direct_state_access " ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) ,
@ -1128,16 +1128,16 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# else
# else
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : WEBGL : : compressed_texture_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : WEBGL : : compressed_texture_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : WEBGL : : compressed_texture_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
# endif
# endif
CubeMapTexture texture ;
CubeMapTexture texture ;
@ -1161,14 +1161,14 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() {
CompressedPixelStorageData [ testCaseInstanceId ( ) ] . dataSparse ,
CompressedPixelStorageData [ testCaseInstanceId ( ) ] . dataSparse ,
BufferUsage : : StaticDraw } ) ;
BufferUsage : : StaticDraw } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
CompressedBufferImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 ,
CompressedBufferImage2D image = texture . compressedImage ( CubeMapCoordinate : : PositiveX , 0 ,
{ } , BufferUsage : : StaticRead ) ;
{ } , BufferUsage : : StaticRead ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 12 } ) ;
CORRADE_COMPARE ( image . size ( ) , Vector2i { 12 } ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( imageData ) ,
@ -1182,27 +1182,27 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() {
void CubeMapTextureGLTest : : compressedSubImageQuery ( ) {
void CubeMapTextureGLTest : : compressedSubImageQuery ( ) {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : get_texture_sub_image > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : get_texture_sub_image > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
/* I'm too lazy to call setSubImage() six times */
/* I'm too lazy to call setSubImage() six times */
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage = = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : internalformat_query2 > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage = = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : internalformat_query2 > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : internalformat_query2 : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : internalformat_query2 : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 12 } )
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 12 } )
. setCompressedSubImage ( 0 , { } , CompressedImageView3D { CompressedPixelFormat : : RGBAS3tcDxt3 , { 12 , 12 , 1 } , CompressedSubDataComplete } ) ;
. setCompressedSubImage ( 0 , { } , CompressedImageView3D { CompressedPixelFormat : : RGBAS3tcDxt3 , { 12 , 12 , 1 } , CompressedSubDataComplete } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CompressedImage3D image = texture . compressedSubImage ( 0 , Range3Di : : fromSize ( { 4 , 4 , 0 } , { 4 , 4 , 1 } ) , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
CompressedImage3D image = texture . compressedSubImage ( 0 , Range3Di : : fromSize ( { 4 , 4 , 0 } , { 4 , 4 , 1 } ) , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 1 } ) ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 1 } ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -1213,28 +1213,28 @@ void CubeMapTextureGLTest::compressedSubImageQuery() {
void CubeMapTextureGLTest : : compressedSubImageQueryBuffer ( ) {
void CubeMapTextureGLTest : : compressedSubImageQueryBuffer ( ) {
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : get_texture_sub_image > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : get_texture_sub_image > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : get_texture_sub_image : : string ( ) + std : : string ( " is not supported. " ) ) ;
/* I'm too lazy to call setSubImage() six times */
/* I'm too lazy to call setSubImage() six times */
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage = = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : internalformat_query2 > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage = = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : internalformat_query2 > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : internalformat_query2 : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : internalformat_query2 : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 12 } )
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 12 } )
. setCompressedSubImage ( 0 , { } , CompressedImageView3D { CompressedPixelFormat : : RGBAS3tcDxt3 , { 12 , 12 , 1 } , CompressedSubDataComplete } ) ;
. setCompressedSubImage ( 0 , { } , CompressedImageView3D { CompressedPixelFormat : : RGBAS3tcDxt3 , { 12 , 12 , 1 } , CompressedSubDataComplete } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CompressedBufferImage3D image = texture . compressedSubImage ( 0 , Range3Di : : fromSize ( { 4 , 4 , 0 } , { 4 , 4 , 1 } ) , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } , BufferUsage : : StaticRead ) ;
CompressedBufferImage3D image = texture . compressedSubImage ( 0 , Range3Di : : fromSize ( { 4 , 4 , 0 } , { 4 , 4 , 1 } ) , { CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage } , BufferUsage : : StaticRead ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 1 } ) ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 1 } ) ) ;
CORRADE_COMPARE_AS (
CORRADE_COMPARE_AS (
@ -1248,8 +1248,8 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() {
void CubeMapTextureGLTest : : fullImageQuery ( ) {
void CubeMapTextureGLTest : : fullImageQuery ( ) {
setTestCaseDescription ( FullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( FullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 2 , 2 } )
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 2 , 2 } )
@ -1257,12 +1257,12 @@ void CubeMapTextureGLTest::fullImageQuery() {
PixelFormat : : RGBA , PixelType : : UnsignedByte , { 2 , 2 , 6 } ,
PixelFormat : : RGBA , PixelType : : UnsignedByte , { 2 , 2 , 6 } ,
FullPixelStorageData [ testCaseInstanceId ( ) ] . data } ) ;
FullPixelStorageData [ testCaseInstanceId ( ) ] . data } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
Image3D image = texture . image ( 0 ,
Image3D image = texture . image ( 0 ,
{ FullPixelStorageData [ testCaseInstanceId ( ) ] . storage , PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
{ FullPixelStorageData [ testCaseInstanceId ( ) ] . storage , PixelFormat : : RGBA , PixelType : : UnsignedByte } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 6 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 6 ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( FullPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( FullPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -1273,8 +1273,8 @@ void CubeMapTextureGLTest::fullImageQuery() {
void CubeMapTextureGLTest : : fullImageQueryBuffer ( ) {
void CubeMapTextureGLTest : : fullImageQueryBuffer ( ) {
setTestCaseDescription ( FullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( FullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 2 } )
texture . setStorage ( 1 , TextureFormat : : RGBA8 , Vector2i { 2 } )
@ -1283,13 +1283,13 @@ void CubeMapTextureGLTest::fullImageQueryBuffer() {
FullPixelStorageData [ testCaseInstanceId ( ) ] . data ,
FullPixelStorageData [ testCaseInstanceId ( ) ] . data ,
BufferUsage : : StaticDraw } ) ;
BufferUsage : : StaticDraw } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
BufferImage3D image = texture . image ( 0 ,
BufferImage3D image = texture . image ( 0 ,
{ FullPixelStorageData [ testCaseInstanceId ( ) ] . storage , PixelFormat : : RGBA ,
{ FullPixelStorageData [ testCaseInstanceId ( ) ] . storage , PixelFormat : : RGBA ,
PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
PixelType : : UnsignedByte } , BufferUsage : : StaticRead ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 6 ) ) ;
CORRADE_COMPARE ( image . size ( ) , Vector3i ( 2 , 2 , 6 ) ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
@ -1300,12 +1300,12 @@ void CubeMapTextureGLTest::fullImageQueryBuffer() {
void CubeMapTextureGLTest : : compressedFullImageQuery ( ) {
void CubeMapTextureGLTest : : compressedFullImageQuery ( ) {
setTestCaseDescription ( CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 4 } )
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 4 } )
@ -1313,11 +1313,11 @@ void CubeMapTextureGLTest::compressedFullImageQuery() {
CompressedPixelFormat : : RGBAS3tcDxt3 , { 4 , 4 , 6 } ,
CompressedPixelFormat : : RGBAS3tcDxt3 , { 4 , 4 , 6 } ,
CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . data } ) ;
CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . data } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CompressedImage3D image = texture . compressedImage ( 0 , { CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
CompressedImage3D image = texture . compressedImage ( 0 , { CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . storage } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 6 } ) ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 6 } ) ) ;
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
CORRADE_COMPARE_AS ( Containers : : arrayCast < UnsignedByte > ( image . data ( ) ) . suffix ( CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . offset ) ,
@ -1328,12 +1328,12 @@ void CubeMapTextureGLTest::compressedFullImageQuery() {
void CubeMapTextureGLTest : : compressedFullImageQueryBuffer ( ) {
void CubeMapTextureGLTest : : compressedFullImageQueryBuffer ( ) {
setTestCaseDescription ( CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
setTestCaseDescription ( CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . name ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : direct_state_access > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : direct_state_access > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : direct_state_access : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : EXT : : texture_compression_s3tc > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : EXT : : texture_compression_s3tc > ( ) )
CORRADE_SKIP ( Extensions : : GL : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : EXT : : texture_compression_s3tc : : string ( ) + std : : string ( " is not supported. " ) ) ;
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : compressed_texture_pixel_storage > ( ) )
if ( CompressedPixelStorageData [ testCaseInstanceId ( ) ] . storage ! = CompressedPixelStorage { } & & ! Context : : current ( ) . isExtensionSupported < Extensions : : ARB : : compressed_texture_pixel_storage > ( ) )
CORRADE_SKIP ( Extensions : : GL : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CORRADE_SKIP ( Extensions : : ARB : : compressed_texture_pixel_storage : : string ( ) + std : : string ( " is not supported. " ) ) ;
CubeMapTexture texture ;
CubeMapTexture texture ;
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 4 } )
texture . setStorage ( 1 , TextureFormat : : CompressedRGBAS3tcDxt3 , Vector2i { 4 } )
@ -1342,11 +1342,11 @@ void CubeMapTextureGLTest::compressedFullImageQueryBuffer() {
CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . data ,
CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . data ,
BufferUsage : : StaticDraw } ) ;
BufferUsage : : StaticDraw } ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CompressedBufferImage3D image = texture . compressedImage ( 0 , { CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . storage } , BufferUsage : : StaticRead ) ;
CompressedBufferImage3D image = texture . compressedImage ( 0 , { CompressedFullPixelStorageData [ testCaseInstanceId ( ) ] . storage } , BufferUsage : : StaticRead ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 6 } ) ) ;
CORRADE_COMPARE ( image . size ( ) , ( Vector3i { 4 , 4 , 6 } ) ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
const auto imageData = image . buffer ( ) . data ( ) ;
@ -1385,7 +1385,7 @@ void CubeMapTextureGLTest::generateMipmap() {
texture . generateMipmap ( ) ;
texture . generateMipmap ( ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
/** @todo How to test this on ES? */
/** @todo How to test this on ES? */
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
@ -1396,7 +1396,7 @@ void CubeMapTextureGLTest::generateMipmap() {
CORRADE_COMPARE ( texture . imageSize ( 4 ) , Vector2i ( 2 ) ) ;
CORRADE_COMPARE ( texture . imageSize ( 4 ) , Vector2i ( 2 ) ) ;
CORRADE_COMPARE ( texture . imageSize ( 5 ) , Vector2i ( 1 ) ) ;
CORRADE_COMPARE ( texture . imageSize ( 5 ) , Vector2i ( 1 ) ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
# endif
# endif
}
}
@ -1411,7 +1411,7 @@ void CubeMapTextureGLTest::invalidateImage() {
Vector2i ( 32 ) ) ;
Vector2i ( 32 ) ) ;
texture . invalidateImage ( 1 ) ;
texture . invalidateImage ( 1 ) ;
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
void CubeMapTextureGLTest : : invalidateSubImage ( ) {
void CubeMapTextureGLTest : : invalidateSubImage ( ) {
@ -1435,10 +1435,10 @@ void CubeMapTextureGLTest::invalidateSubImage() {
" Broken on Mesa. " ) ;
" Broken on Mesa. " ) ;
# endif
# endif
MAGNUM_VERIFY_NO_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ ERROR ( ) ;
}
}
}
}
} }
} } }
CORRADE_TEST_MAIN ( Magnum : : Test : : CubeMapTextureGLTest )
CORRADE_TEST_MAIN ( Magnum : : GL : : Test : : CubeMapTextureGLTest )