summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-08-17 10:02:19 +0200
committerwwylele <wwylele@gmail.com>2017-08-21 07:03:07 +0200
commit63b6e802cdffc1464b4a1fe3f5171d71146e8e9a (patch)
tree3faf0b0644a78efb26174059971caed76ab281fe
parentswrasterizer/clipper: remove tested TODO (diff)
downloadyuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.tar
yuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.tar.gz
yuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.tar.bz2
yuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.tar.lz
yuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.tar.xz
yuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.tar.zst
yuzu-63b6e802cdffc1464b4a1fe3f5171d71146e8e9a.zip
-rw-r--r--src/video_core/swrasterizer/rasterizer.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.h b/src/video_core/swrasterizer/rasterizer.h
index 2f0877581..66cd6cfd4 100644
--- a/src/video_core/swrasterizer/rasterizer.h
+++ b/src/video_core/swrasterizer/rasterizer.h
@@ -19,10 +19,9 @@ struct Vertex : Shader::OutputVertex {
// Linear interpolation
// factor: 0=this, 1=vtx
+ // Note: This function cannot be called after perspective divide
void Lerp(float24 factor, const Vertex& vtx) {
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);
@@ -30,12 +29,11 @@ struct Vertex : Shader::OutputVertex {
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);
}
// Linear interpolation
// factor: 0=v0, 1=v1
+ // Note: This function cannot be called after perspective divide
static Vertex Lerp(float24 factor, const Vertex& v0, const Vertex& v1) {
Vertex ret = v0;
ret.Lerp(factor, v1);