From 1227bd2ba6f6d5ba984751bc5985879b3c19ce4f Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Tue, 14 Oct 2014 12:34:37 +0200 Subject: [PATCH] PixelShaderGen: replace multiplication with shift iirc both nvidia and i965 doesn't optimize this --- Source/Core/VideoCommon/PixelShaderGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 8e90713fd0..fd125c565e 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -894,7 +894,7 @@ static inline void WriteTevRegular(T& out, const char* components, int bias, int // - a rounding bias is added before dividing by 256 out.Write("(((tevin_d.%s%s)%s)", components, tevBiasTable[bias], tevScaleTableLeft[shift]); out.Write(" %s ", tevOpTable[op]); - out.Write("((((tevin_a.%s*256 + (tevin_b.%s-tevin_a.%s)*(tevin_c.%s+(tevin_c.%s>>7)))%s)%s)>>8)", + out.Write("(((((tevin_a.%s<<8) + (tevin_b.%s-tevin_a.%s)*(tevin_c.%s+(tevin_c.%s>>7)))%s)%s)>>8)", components, components, components, components, components, tevScaleTableLeft[shift], tevLerpBias[2*op+(shift!=3)]); out.Write(")%s", tevScaleTableRight[shift]);