Permalink
Browse files

PixelShaderGen: Ensure all components of ocol1 are initialized

This was causing a warning in the shader compiler, as the rgb components
were not initialized. Which shouldn't be an issue, as the rgb is not
used in the blend equation, only the alpha. However, the lack of
initialization causes crashes in Intel's D3D shader compiler, so we'll
play nice and initialize all the channels.
  • Loading branch information...
stenzek committed Aug 24, 2018
1 parent 248afb9 commit bae1168fe93023e598222bbff7aac2d8aa399ef0
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -1406,13 +1406,13 @@ static void WriteColor(ShaderCode& out, APIType api_type, const pixel_shader_uid
// 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");
out.Write("\tocol1 = float4(0.0, 0.0, 0.0, float(prev.a) / 255.0);\n");
}
else
{
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 = float4(0.0, 0.0, 0.0, float(prev.a) / 255.0);\n");
}
}

0 comments on commit bae1168

Please sign in to comment.