From 5c406b5ef0a0604bd443b4f3e7d52b2ac6fbc2cf Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sun, 23 Oct 2016 19:54:28 +0200 Subject: [PATCH] PixelShaderGen: Fix implicit type conversions. --- Source/Core/VideoCommon/PixelShaderGen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index f3a91433c6..3442bf40c5 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1288,26 +1288,26 @@ static void WriteFog(ShaderCode& out, const pixel_shader_uid_data* uid_data) static void WriteColor(ShaderCode& out, const pixel_shader_uid_data* uid_data) { if (uid_data->rgba6_format) - out.Write("\tocol0.rgb = (prev.rgb >> 2) / 63.0;\n"); + out.Write("\tocol0.rgb = float3(prev.rgb >> 2) / 63.0;\n"); else - out.Write("\tocol0.rgb = prev.rgb / 255.0;\n"); + out.Write("\tocol0.rgb = float3(prev.rgb) / 255.0;\n"); // 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->dstAlphaMode == DSTALPHA_NONE) { - out.Write("\tocol0.a = (prev.a >> 2) / 63.0;\n"); - out.Write("\tocol1.a = prev.a / 255.0;\n"); + out.Write("\tocol0.a = float(prev.a >> 2) / 63.0;\n"); + out.Write("\tocol1.a = float(prev.a) / 255.0;\n"); } else { out.SetConstantsUsed(C_ALPHA, C_ALPHA); - out.Write("\tocol0.a = (" I_ALPHA ".a >> 2) / 63.0;\n"); + 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 (uid_data->dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND) - out.Write("\tocol1.a = prev.a / 255.0;\n"); + out.Write("\tocol1.a = float(prev.a) / 255.0;\n"); else - out.Write("\tocol1.a = " I_ALPHA ".a / 255.0;\n"); + out.Write("\tocol1.a = float(" I_ALPHA ".a) / 255.0;\n"); } }