mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 07:35:41 +00:00
GPU/ShaderGen: Move discard to end of shader
Possible workaround for this PowerVR driver issue.
This commit is contained in:
parent
19ca102b40
commit
22d664b210
|
@ -931,10 +931,6 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords)
|
|||
// Apply semitransparency. If not a semitransparent texel, destination alpha is ignored.
|
||||
if (semitransparent)
|
||||
{
|
||||
#if TRANSPARENCY_ONLY_OPAQUE
|
||||
discard;
|
||||
#endif
|
||||
|
||||
#if USE_DUAL_SOURCE
|
||||
o_col0 = float4(color, oalpha);
|
||||
o_col1 = float4(0.0, 0.0, 0.0, u_dst_alpha_factor / ialpha);
|
||||
|
@ -945,13 +941,13 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords)
|
|||
#if !PGXP_DEPTH
|
||||
o_depth = oalpha * v_pos.z;
|
||||
#endif
|
||||
|
||||
#if TRANSPARENCY_ONLY_OPAQUE
|
||||
discard;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#if TRANSPARENCY_ONLY_TRANSPARENT
|
||||
discard;
|
||||
#endif
|
||||
|
||||
#if USE_DUAL_SOURCE
|
||||
o_col0 = float4(color, oalpha);
|
||||
o_col1 = float4(0.0, 0.0, 0.0, 1.0 - ialpha);
|
||||
|
@ -962,6 +958,10 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords)
|
|||
#if !PGXP_DEPTH
|
||||
o_depth = oalpha * v_pos.z;
|
||||
#endif
|
||||
|
||||
#if TRANSPARENCY_ONLY_TRANSPARENT
|
||||
discard;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
// Non-transparency won't enable blending so we can write the mask here regardless.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#include "types.h"
|
||||
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 3;
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 4;
|
Loading…
Reference in a new issue