summaryrefslogtreecommitdiffstats
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-07-11 19:15:23 +0200
committerwwylele <wwylele@gmail.com>2017-07-11 20:35:57 +0200
commitf13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea (patch)
tree66970e5dc2d5bd7de0ea310baa12456ba58f2d6d /src/video_core/swrasterizer/rasterizer.cpp
parentvector_math: remove dead template parameter (diff)
downloadyuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.tar
yuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.tar.gz
yuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.tar.bz2
yuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.tar.lz
yuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.tar.xz
yuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.tar.zst
yuzu-f13cf506e0b0e42e6c9b00b163aaabc3b63fb7ea.zip
Diffstat (limited to 'src/video_core/swrasterizer/rasterizer.cpp')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index b108a0f86..5844c401c 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -599,18 +599,6 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
255),
};
- Math::Quaternion<float> normquat{
- {GetInterpolatedAttribute(v0.quat.x, v1.quat.x, v2.quat.x).ToFloat32(),
- GetInterpolatedAttribute(v0.quat.y, v1.quat.y, v2.quat.y).ToFloat32(),
- GetInterpolatedAttribute(v0.quat.z, v1.quat.z, v2.quat.z).ToFloat32()},
- GetInterpolatedAttribute(v0.quat.w, v1.quat.w, v2.quat.w).ToFloat32(),
- };
-
- Math::Vec3<float> fragment_position{
- GetInterpolatedAttribute(v0.view.x, v1.view.x, v2.view.x).ToFloat32(),
- GetInterpolatedAttribute(v0.view.y, v1.view.y, v2.view.y).ToFloat32(),
- GetInterpolatedAttribute(v0.view.z, v1.view.z, v2.view.z).ToFloat32()};
-
Math::Vec2<float24> uv[3];
uv[0].u() = GetInterpolatedAttribute(v0.tc0.u(), v1.tc0.u(), v2.tc0.u());
uv[0].v() = GetInterpolatedAttribute(v0.tc0.v(), v1.tc0.v(), v2.tc0.v());
@@ -729,8 +717,20 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
Math::Vec4<u8> secondary_fragment_color = {0, 0, 0, 0};
if (!g_state.regs.lighting.disable) {
- std::tie(primary_fragment_color, secondary_fragment_color) = ComputeFragmentsColors(
- g_state.regs.lighting, g_state.lighting, normquat, fragment_position);
+ Math::Quaternion<float> normquat{
+ {GetInterpolatedAttribute(v0.quat.x, v1.quat.x, v2.quat.x).ToFloat32(),
+ GetInterpolatedAttribute(v0.quat.y, v1.quat.y, v2.quat.y).ToFloat32(),
+ GetInterpolatedAttribute(v0.quat.z, v1.quat.z, v2.quat.z).ToFloat32()},
+ GetInterpolatedAttribute(v0.quat.w, v1.quat.w, v2.quat.w).ToFloat32(),
+ };
+
+ Math::Vec3<float> view{
+ GetInterpolatedAttribute(v0.view.x, v1.view.x, v2.view.x).ToFloat32(),
+ GetInterpolatedAttribute(v0.view.y, v1.view.y, v2.view.y).ToFloat32(),
+ GetInterpolatedAttribute(v0.view.z, v1.view.z, v2.view.z).ToFloat32(),
+ };
+ std::tie(primary_fragment_color, secondary_fragment_color) =
+ ComputeFragmentsColors(g_state.regs.lighting, g_state.lighting, normquat, view);
}
for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();