@ -81,27 +81,35 @@ using namespace Math::Literals;
const struct {
const struct {
const char * name ;
const char * name ;
bool framebuffer ;
bool framebuffer , implicitOutputSize ;
Vector2i size ;
Vector2i size ;
Vector2i offset ;
Vector2i offset ;
bool flipX , flipY ;
bool flipX , flipY ;
} RunData [ ] {
} RunData [ ] {
{ " texture output " ,
{ " texture output " ,
false , { 64 , 64 } , { } , false , false } ,
false , false , { 64 , 64 } , { } , false , false } ,
{ " texture output, flipped on X " ,
{ " texture output, flipped on X " ,
false , { 64 , 64 } , { } , true , false } ,
false , false , { 64 , 64 } , { } , true , false } ,
{ " texture output, flipped on Y " ,
{ " texture output, flipped on Y " ,
false , { 64 , 64 } , { } , false , true } ,
false , false , { 64 , 64 } , { } , false , true } ,
{ " texture output, with offset " ,
{ " texture output, with offset " ,
false , { 128 , 96 } , { 64 , 32 } , false , false } ,
false , false , { 128 , 96 } , { 64 , 32 } , false , false } ,
# ifndef MAGNUM_TARGET_GLES
{ " texture output with implicit size " ,
false , true , { 64 , 64 } , { } , false , false } ,
# endif
{ " framebuffer output " ,
{ " framebuffer output " ,
true , { 64 , 64 } , { } , false , false } ,
true , false , { 64 , 64 } , { } , false , false } ,
{ " framebuffer output, flipped on X " ,
{ " framebuffer output, flipped on X " ,
true , { 64 , 64 } , { } , true , false } ,
true , false , { 64 , 64 } , { } , true , false } ,
{ " framebuffer output, flipped on Y " ,
{ " framebuffer output, flipped on Y " ,
true , { 64 , 64 } , { } , false , true } ,
true , false , { 64 , 64 } , { } , false , true } ,
{ " framebuffer output, with offset " ,
{ " framebuffer output, with offset " ,
true , { 128 , 96 } , { 64 , 32 } , false , false } ,
true , false , { 128 , 96 } , { 64 , 32 } , false , false } ,
# ifndef MAGNUM_TARGET_GLES
{ " framebuffer output with implicit size " ,
true , true , { 64 , 64 } , { } , false , false } ,
# endif
} ;
} ;
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
@ -279,17 +287,25 @@ void DistanceFieldGLTest::run() {
MAGNUM_VERIFY_NO_GL_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ERROR ( ) ;
if ( data . framebuffer ) {
if ( data . framebuffer ) {
distanceField ( input , outputFramebuffer , Range2Di : : fromSize ( data . offset , Vector2i { 64 } )
# ifndef MAGNUM_TARGET_GLES
# ifdef MAGNUM_TARGET_GLES
if ( data . implicitOutputSize )
, inputImage - > size ( )
distanceField ( input , outputFramebuffer ,
# endif
Range2Di : : fromSize ( data . offset , Vector2i { 64 } ) ) ;
) ;
else
# endif
distanceField ( input , outputFramebuffer ,
Range2Di : : fromSize ( data . offset , Vector2i { 64 } ) ,
inputImage - > size ( ) ) ;
} else {
} else {
distanceField ( input , outputTexture , Range2Di : : fromSize ( data . offset , Vector2i { 64 } )
# ifndef MAGNUM_TARGET_GLES
# ifdef MAGNUM_TARGET_GLES
if ( data . implicitOutputSize )
, inputImage - > size ( )
distanceField ( input , outputTexture ,
# endif
Range2Di : : fromSize ( data . offset , Vector2i { 64 } ) ) ;
) ;
else
# endif
distanceField ( input , outputTexture ,
Range2Di : : fromSize ( data . offset , Vector2i { 64 } ) ,
inputImage - > size ( ) ) ;
}
}
/* The viewport should stay as it was before */
/* The viewport should stay as it was before */