summaryrefslogtreecommitdiffstats
path: root/src/video_core/swrasterizer
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-08-22 08:47:15 +0200
committerwwylele <wwylele@gmail.com>2017-08-25 06:26:45 +0200
commit417cb45e3fc20a7529ce5d548ba0fbc36ea0a621 (patch)
treec919a7bdbb9dd3eab50a4ff969af8da84c917604 /src/video_core/swrasterizer
parentgl_rasterizer: implement custom clip plane (diff)
downloadyuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.tar
yuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.tar.gz
yuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.tar.bz2
yuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.tar.lz
yuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.tar.xz
yuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.tar.zst
yuzu-417cb45e3fc20a7529ce5d548ba0fbc36ea0a621.zip
Diffstat (limited to 'src/video_core/swrasterizer')
-rw-r--r--src/video_core/swrasterizer/clipper.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/swrasterizer/clipper.cpp b/src/video_core/swrasterizer/clipper.cpp
index cc76ba555..a52129eb7 100644
--- a/src/video_core/swrasterizer/clipper.cpp
+++ b/src/video_core/swrasterizer/clipper.cpp
@@ -31,7 +31,7 @@ public:
: coeffs(coeffs), bias(bias) {}
bool IsInside(const Vertex& vertex) const {
- return Math::Dot(vertex.pos + bias, coeffs) <= float24::FromFloat32(0);
+ return Math::Dot(vertex.pos + bias, coeffs) >= float24::FromFloat32(0);
}
bool IsOutSide(const Vertex& vertex) const {
@@ -116,13 +116,13 @@ void ProcessTriangle(const OutputVertex& v0, const OutputVertex& v1, const Outpu
static const float24 f0 = float24::FromFloat32(0.0);
static const float24 f1 = float24::FromFloat32(1.0);
static const std::array<ClippingEdge, 7> clipping_edges = {{
- {Math::MakeVec(f1, f0, f0, -f1)}, // x = +w
- {Math::MakeVec(-f1, f0, f0, -f1)}, // x = -w
- {Math::MakeVec(f0, f1, f0, -f1)}, // y = +w
- {Math::MakeVec(f0, -f1, f0, -f1)}, // y = -w
- {Math::MakeVec(f0, f0, f1, f0)}, // z = 0
- {Math::MakeVec(f0, f0, -f1, -f1)}, // z = -w
- {Math::MakeVec(f0, f0, f0, -f1), Math::Vec4<float24>(f0, f0, f0, EPSILON)}, // w = EPSILON
+ {Math::MakeVec(-f1, f0, f0, f1)}, // x = +w
+ {Math::MakeVec(f1, f0, f0, f1)}, // x = -w
+ {Math::MakeVec(f0, -f1, f0, f1)}, // y = +w
+ {Math::MakeVec(f0, f1, f0, f1)}, // y = -w
+ {Math::MakeVec(f0, f0, -f1, f0)}, // z = 0
+ {Math::MakeVec(f0, f0, f1, f1)}, // z = -w
+ {Math::MakeVec(f0, f0, f0, f1), Math::Vec4<float24>(f0, f0, f0, EPSILON)}, // w = EPSILON
}};
// Simple implementation of the Sutherland-Hodgman clipping algorithm.
@@ -157,7 +157,7 @@ void ProcessTriangle(const OutputVertex& v0, const OutputVertex& v1, const Outpu
}
if (g_state.regs.rasterizer.clip_enable) {
- ClippingEdge custom_edge{-g_state.regs.rasterizer.GetClipCoef()};
+ ClippingEdge custom_edge{g_state.regs.rasterizer.GetClipCoef()};
Clip(custom_edge);
if (output_list->size() < 3)