@@ -256,6 +256,10 @@ A. Or use FXAA_GREEN_AS_LUMA.
256
256
#define FXAA_GLSL_130 0
257
257
#endif
258
258
/* --------------------------------------------------------------------------*/
259
+ #ifndef FXAA_GLSL_400
260
+ #define FXAA_GLSL_400 0
261
+ #endif
262
+ /* --------------------------------------------------------------------------*/
259
263
#ifndef FXAA_HLSL_3
260
264
#define FXAA_HLSL_3 0
261
265
#endif
@@ -342,8 +346,8 @@ A. Or use FXAA_GREEN_AS_LUMA.
342
346
// 1 = API supports gather4 on alpha channel.
343
347
// 0 = API does not support gather4 on alpha channel.
344
348
//
345
- #if (FXAA_GLSL_130 == 0 )
346
- #define FXAA_GATHER4_ALPHA 0
349
+ #if (FXAA_GLSL_400 == 1 )
350
+ #define FXAA_GATHER4_ALPHA 1
347
351
#endif
348
352
#if (FXAA_HLSL_5 == 1 )
349
353
#define FXAA_GATHER4_ALPHA 1
@@ -652,7 +656,7 @@ NOTE the other tuning knobs are now in the shader function inputs!
652
656
API PORTING
653
657
654
658
============================================================================*/
655
- #if (FXAA_GLSL_120 == 1 ) || (FXAA_GLSL_130 == 1 )
659
+ #if (FXAA_GLSL_120 == 1 ) || (FXAA_GLSL_130 == 1 ) || (FXAA_GLSL_400 == 1 )
656
660
#define FxaaBool bool
657
661
#define FxaaDiscard discard
658
662
#define FxaaFloat float
@@ -714,6 +718,16 @@ NOTE the other tuning knobs are now in the shader function inputs!
714
718
#endif
715
719
#endif
716
720
/* --------------------------------------------------------------------------*/
721
+ #if (FXAA_GLSL_400 == 1 )
722
+ // Requires "#version 400" or better
723
+ #define FxaaTexTop(t, p) textureLod(t, p, 0.0 )
724
+ #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0 , o)
725
+ #define FxaaTexAlpha4(t, p) textureGather(t, p, 3 )
726
+ #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3 )
727
+ #define FxaaTexGreen4(t, p) textureGather(t, p, 1 )
728
+ #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1 )
729
+ #endif
730
+ /* --------------------------------------------------------------------------*/
717
731
#if (FXAA_HLSL_3 == 1 ) || (FXAA_360 == 1 ) || (FXAA_PS3 == 1 )
718
732
#define FxaaInt2 float2
719
733
#define FxaaTex sampler2D
0 commit comments