summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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:
31 : coeffs(coeffs), bias(bias) {} 31 : coeffs(coeffs), bias(bias) {}
32 32
33 bool IsInside(const Vertex& vertex) const { 33 bool IsInside(const Vertex& vertex) const {
34 return Math::Dot(vertex.pos + bias, coeffs) <= float24::FromFloat32(0); 34 return Math::Dot(vertex.pos + bias, coeffs) >= float24::FromFloat32(0);
35 } 35 }
36 36
37 bool IsOutSide(const Vertex& vertex) const { 37 bool IsOutSide(const Vertex& vertex) const {
@@ -116,13 +116,13 @@ void ProcessTriangle(const OutputVertex& v0, const OutputVertex& v1, const Outpu
116 static const float24 f0 = float24::FromFloat32(0.0); 116 static const float24 f0 = float24::FromFloat32(0.0);
117 static const float24 f1 = float24::FromFloat32(1.0); 117 static const float24 f1 = float24::FromFloat32(1.0);
118 static const std::array<ClippingEdge, 7> clipping_edges = {{ 118 static const std::array<ClippingEdge, 7> clipping_edges = {{
119 {Math::MakeVec(f1, f0, f0, -f1)}, // x = +w 119 {Math::MakeVec(-f1, f0, f0, f1)}, // x = +w
120 {Math::MakeVec(-f1, f0, f0, -f1)}, // x = -w 120 {Math::MakeVec(f1, f0, f0, f1)}, // x = -w
121 {Math::MakeVec(f0, f1, f0, -f1)}, // y = +w 121 {Math::MakeVec(f0, -f1, f0, f1)}, // y = +w
122 {Math::MakeVec(f0, -f1, f0, -f1)}, // y = -w 122 {Math::MakeVec(f0, f1, f0, f1)}, // y = -w
123 {Math::MakeVec(f0, f0, f1, f0)}, // z = 0 123 {Math::MakeVec(f0, f0, -f1, f0)}, // z = 0
124 {Math::MakeVec(f0, f0, -f1, -f1)}, // z = -w 124 {Math::MakeVec(f0, f0, f1, f1)}, // z = -w
125 {Math::MakeVec(f0, f0, f0, -f1), Math::Vec4<float24>(f0, f0, f0, EPSILON)}, // w = EPSILON 125 {Math::MakeVec(f0, f0, f0, f1), Math::Vec4<float24>(f0, f0, f0, EPSILON)}, // w = EPSILON
126 }}; 126 }};
127 127
128 // Simple implementation of the Sutherland-Hodgman clipping algorithm. 128 // Simple implementation of the Sutherland-Hodgman clipping algorithm.
@@ -157,7 +157,7 @@ void ProcessTriangle(const OutputVertex& v0, const OutputVertex& v1, const Outpu
157 } 157 }
158 158
159 if (g_state.regs.rasterizer.clip_enable) { 159 if (g_state.regs.rasterizer.clip_enable) {
160 ClippingEdge custom_edge{-g_state.regs.rasterizer.GetClipCoef()}; 160 ClippingEdge custom_edge{g_state.regs.rasterizer.GetClipCoef()};
161 Clip(custom_edge); 161 Clip(custom_edge);
162 162
163 if (output_list->size() < 3) 163 if (output_list->size() < 3)