From 55e02369a58dea48a4c3632787d77e294a4ece7d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 24 Aug 2013 11:33:49 -0700 Subject: [PATCH] Workaround an ICE in some versions of gcc. --- GPU/Software/Rasterizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 62a9137d12..7693957c98 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -726,7 +726,8 @@ void DrawTriangle(const VertexData& v0, const VertexData& v1, const VertexData& // TODO: Fogging // TODO: Is that the correct way to interpolate? - u16 z = (u16)(((float)v0.screenpos.z * w0 + (float)v1.screenpos.z * w1 + (float)v2.screenpos.z * w2) / (w0+w1+w2)); + // With the (u32), this causes an ICE in some versions of gcc. + u16 z = (u16)(u32)(((float)v0.screenpos.z * w0 + (float)v1.screenpos.z * w1 + (float)v2.screenpos.z * w2) / (w0+w1+w2)); // Depth range test if (!gstate.isModeThrough())