tfx.fx: Add support for dfmt to pick the shader for 16bit alpha output.

This commit is contained in:
lightningterror 2018-12-18 08:31:20 +01:00
parent 5527bcb13e
commit 59752120d6
1 changed files with 3 additions and 2 deletions

View File

@ -39,6 +39,7 @@
#define PS_POINT_SAMPLER 0 #define PS_POINT_SAMPLER 0
#define PS_SHUFFLE 0 #define PS_SHUFFLE 0
#define PS_READ_BA 0 #define PS_READ_BA 0
#define PS_DFMT 0
#define PS_DEPTH_FMT 0 #define PS_DEPTH_FMT 0
#define PS_PAL_FMT 0 #define PS_PAL_FMT 0
#define PS_CHANNEL_FETCH 0 #define PS_CHANNEL_FETCH 0
@ -1002,13 +1003,13 @@ PS_OUTPUT ps_main(PS_INPUT input)
output.c1 = c.a * 2; // used for alpha blending output.c1 = c.a * 2; // used for alpha blending
if(PS_AOUT) // 16 bit output if((PS_DFMT == FMT_16) || PS_AOUT) // 16 bit output
{ {
float a = 128.0f / 255; // alpha output will be 0x80 float a = 128.0f / 255; // alpha output will be 0x80
c.a = PS_FBA ? a : step(0.5, c.a) * a; c.a = PS_FBA ? a : step(0.5, c.a) * a;
} }
else if(PS_FBA) else if((PS_DFMT == FMT_32) && PS_FBA)
{ {
if(c.a < 0.5) c.a += 0.5; if(c.a < 0.5) c.a += 0.5;
} }