From dc48deaeccc41a3e86d5c63523e712f4bb8618c2 Mon Sep 17 00:00:00 2001 From: Dwayne Slater Date: Wed, 8 Nov 2017 20:42:25 -0500 Subject: [PATCH] Round primary color inputs in software rasterizer OpenGL version coming soon. --- src/video_core/swrasterizer/rasterizer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 533ee6f01..2ee28ed53 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -293,18 +293,18 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve }; Math::Vec4 primary_color{ - (u8)( + static_cast(round( GetInterpolatedAttribute(v0.color.r(), v1.color.r(), v2.color.r()).ToFloat32() * - 255), - (u8)( + 255)), + static_cast(round( GetInterpolatedAttribute(v0.color.g(), v1.color.g(), v2.color.g()).ToFloat32() * - 255), - (u8)( + 255)), + static_cast(round( GetInterpolatedAttribute(v0.color.b(), v1.color.b(), v2.color.b()).ToFloat32() * - 255), - (u8)( + 255)), + static_cast(round( GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() * - 255), + 255)), }; Math::Vec2 uv[3];