summaryrefslogtreecommitdiffstats
path: root/src/video_core/rasterizer.cpp
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2015-01-02 20:37:25 +0100
committerTony Wasserka <NeoBrainX@gmail.com>2015-02-18 14:50:03 +0100
commit365236fa4c96eaba94b715b6844bff64238b70e5 (patch)
tree798fde7c74933dbc369617c2fd9641fdfa6e375f /src/video_core/rasterizer.cpp
parentPica/VertexShader: Implement the LOOP instruction. (diff)
downloadyuzu-365236fa4c96eaba94b715b6844bff64238b70e5.tar
yuzu-365236fa4c96eaba94b715b6844bff64238b70e5.tar.gz
yuzu-365236fa4c96eaba94b715b6844bff64238b70e5.tar.bz2
yuzu-365236fa4c96eaba94b715b6844bff64238b70e5.tar.lz
yuzu-365236fa4c96eaba94b715b6844bff64238b70e5.tar.xz
yuzu-365236fa4c96eaba94b715b6844bff64238b70e5.tar.zst
yuzu-365236fa4c96eaba94b715b6844bff64238b70e5.zip
Diffstat (limited to 'src/video_core/rasterizer.cpp')
-rw-r--r--src/video_core/rasterizer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 3faa10153..046c010ef 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -106,16 +106,17 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
ScreenToRasterizerCoordinates(v1.screenpos),
ScreenToRasterizerCoordinates(v2.screenpos) };
- if (registers.cull_mode == Regs::CullMode::KeepClockWise) {
- // Reverse vertex order and use the CCW code path.
+ if (registers.cull_mode == Regs::CullMode::KeepCounterClockWise) {
+ // Reverse vertex order and use the CW code path.
std::swap(vtxpos[1], vtxpos[2]);
}
if (registers.cull_mode != Regs::CullMode::KeepAll) {
- // Cull away triangles which are wound clockwise.
- // TODO: A check for degenerate triangles ("== 0") should be considered for CullMode::KeepAll
+ // Cull away triangles which are wound counter-clockwise.
if (SignedArea(vtxpos[0].xy(), vtxpos[1].xy(), vtxpos[2].xy()) <= 0)
return;
+ } else {
+ // TODO: Consider A check for degenerate triangles ("SignedArea == 0")
}
// TODO: Proper scissor rect test!
@@ -475,7 +476,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
// TODO: Does depth indeed only get written even if depth testing is enabled?
if (registers.output_merger.depth_test_enable) {
- u16 z = (u16)(-(v0.screenpos[2].ToFloat32() * w0 +
+ u16 z = (u16)((v0.screenpos[2].ToFloat32() * w0 +
v1.screenpos[2].ToFloat32() * w1 +
v2.screenpos[2].ToFloat32() * w2) * 65535.f / wsum);
u16 ref_z = GetDepth(x >> 4, y >> 4);