GPU/HW: Fix mask bit when rendering with transparency and no DSB

Fixes some sprites in Bloody Roar on Mali GPUs.
This commit is contained in:
Connor McLaughlin
2021-02-06 20:05:57 +10:00
parent 011df33fc4
commit 837fb6128b
6 changed files with 69 additions and 48 deletions

View File

@ -939,12 +939,12 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords)
o_col0 = float4(color, oalpha);
o_col1 = float4(0.0, 0.0, 0.0, u_dst_alpha_factor / ialpha);
#else
o_col0 = float4(color, u_dst_alpha_factor / ialpha);
o_col0 = float4(color, oalpha);
#endif
#if !PGXP_DEPTH
o_depth = oalpha * v_pos.z;
#endif
#if !PGXP_DEPTH
o_depth = oalpha * v_pos.z;
#endif
}
else
{
@ -952,24 +952,16 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords)
discard;
#endif
#if TRANSPARENCY_ONLY_OPAQUE
// We don't output the second color here because it's not used (except for filtering).
#if USE_DUAL_SOURCE
o_col0 = float4(color, oalpha);
#if USE_DUAL_SOURCE
o_col1 = float4(0.0, 0.0, 0.0, 1.0 - ialpha);
#endif
o_col1 = float4(0.0, 0.0, 0.0, 1.0 - ialpha);
#else
#if USE_DUAL_SOURCE
o_col0 = float4(color, oalpha);
o_col1 = float4(0.0, 0.0, 0.0, 1.0 - ialpha);
#else
o_col0 = float4(color, 1.0 - ialpha);
#endif
o_col0 = float4(color, oalpha);
#endif
#if !PGXP_DEPTH
o_depth = oalpha * v_pos.z;
#endif
#if !PGXP_DEPTH
o_depth = oalpha * v_pos.z;
#endif
}
#else
// Non-transparency won't enable blending so we can write the mask here regardless.
@ -979,9 +971,9 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords)
o_col1 = float4(0.0, 0.0, 0.0, 1.0 - ialpha);
#endif
#if !PGXP_DEPTH
o_depth = oalpha * v_pos.z;
#endif
#if !PGXP_DEPTH
o_depth = oalpha * v_pos.z;
#endif
#endif
}
)";