diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-03-27 18:44:10 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-03-27 18:53:17 -0400 |
| commit | f10198500e968fafe0c019467a1eea7fe78630c5 (patch) | |
| tree | a642fe85cb37ea876f3e28d176f7c4dc76802a37 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | c9e0045881ee98bb6fb3d6d9e8e426877124b294 (diff) | |
PixelShaderGen: Invert conditional in WriteColor()
Puts the true condition body first instead of the false one for better
reading.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 4e48ba1bbd..61c39a54fe 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1394,22 +1394,20 @@ static void WriteColor(ShaderCode& out, APIType api_type, const pixel_shader_uid // Colors will be blended against the 8-bit alpha from ocol1 and // the 6-bit alpha from ocol0 will be written to the framebuffer - if (!uid_data->useDstAlpha) + if (uid_data->useDstAlpha) { - out.Write("\tocol0.a = float(prev.a >> 2) / 63.0;\n"); + out.SetConstantsUsed(C_ALPHA, C_ALPHA); + out.Write("\tocol0.a = float(" I_ALPHA ".a >> 2) / 63.0;\n"); + + // Use dual-source color blending to perform dst alpha in a single pass if (use_dual_source) out.Write("\tocol1.a = float(prev.a) / 255.0;\n"); } else { - out.SetConstantsUsed(C_ALPHA, C_ALPHA); - out.Write("\tocol0.a = float(" I_ALPHA ".a >> 2) / 63.0;\n"); - - // Use dual-source color blending to perform dst alpha in a single pass + out.Write("\tocol0.a = float(prev.a >> 2) / 63.0;\n"); if (use_dual_source) - { - out.Write("\tocol1.a = float(prev.a) / 255.0;\n"); - } + out.Write("\tocol1.a = float(prev.a) / 255.0;\n"); } } |
