diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-05-21 09:19:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-21 09:19:46 +0200 |
commit | d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75 (patch) | |
tree | f8d81b42dc7165e7ff91d3c9d1a1c3bdb2c98e27 | |
parent | Merge pull request #2661 from Subv/uds5 (diff) | |
parent | swrasterizer: add missing tc0_w and fragment lighting attribute processing (diff) | |
download | yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.tar yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.tar.gz yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.tar.bz2 yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.tar.lz yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.tar.xz yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.tar.zst yuzu-d2bb0a6f2d8457a910ecd8f1dcc7d1f496617b75.zip |
-rw-r--r-- | src/video_core/swrasterizer/clipper.cpp | 7 | ||||
-rw-r--r-- | src/video_core/swrasterizer/rasterizer.h | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/video_core/swrasterizer/clipper.cpp b/src/video_core/swrasterizer/clipper.cpp index 2d80822d9..6fb923756 100644 --- a/src/video_core/swrasterizer/clipper.cpp +++ b/src/video_core/swrasterizer/clipper.cpp @@ -69,13 +69,14 @@ static void InitScreenCoordinates(Vertex& vtx) { viewport.offset_y = float24::FromFloat32(static_cast<float>(regs.rasterizer.viewport_corner.y)); float24 inv_w = float24::FromFloat32(1.f) / vtx.pos.w; - vtx.color *= inv_w; - vtx.view *= inv_w; + vtx.pos.w = inv_w; vtx.quat *= inv_w; + vtx.color *= inv_w; vtx.tc0 *= inv_w; vtx.tc1 *= inv_w; + vtx.tc0_w *= inv_w; + vtx.view *= inv_w; vtx.tc2 *= inv_w; - vtx.pos.w = inv_w; vtx.screenpos[0] = (vtx.pos.x * inv_w + float24::FromFloat32(1.0)) * viewport.halfsize_x + viewport.offset_x; diff --git a/src/video_core/swrasterizer/rasterizer.h b/src/video_core/swrasterizer/rasterizer.h index 3a72ac343..2f0877581 100644 --- a/src/video_core/swrasterizer/rasterizer.h +++ b/src/video_core/swrasterizer/rasterizer.h @@ -23,13 +23,15 @@ struct Vertex : Shader::OutputVertex { pos = pos * factor + vtx.pos * (float24::FromFloat32(1) - factor); // TODO: Should perform perspective correct interpolation here... + quat = quat * factor + vtx.quat * (float24::FromFloat32(1) - factor); + color = color * factor + vtx.color * (float24::FromFloat32(1) - factor); tc0 = tc0 * factor + vtx.tc0 * (float24::FromFloat32(1) - factor); tc1 = tc1 * factor + vtx.tc1 * (float24::FromFloat32(1) - factor); + tc0_w = tc0_w * factor + vtx.tc0_w * (float24::FromFloat32(1) - factor); + view = view * factor + vtx.view * (float24::FromFloat32(1) - factor); tc2 = tc2 * factor + vtx.tc2 * (float24::FromFloat32(1) - factor); screenpos = screenpos * factor + vtx.screenpos * (float24::FromFloat32(1) - factor); - - color = color * factor + vtx.color * (float24::FromFloat32(1) - factor); } // Linear interpolation |