summaryrefslogtreecommitdiffstats
path: root/src/video_core/clipper.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/clipper.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp
index ba3876a76..943f3eb35 100644
--- a/src/video_core/clipper.cpp
+++ b/src/video_core/clipper.cpp
@@ -58,12 +58,13 @@ static void InitScreenCoordinates(OutputVertex& vtx)
float24 offset_z;
} viewport;
- viewport.halfsize_x = float24::FromRawFloat24(registers.viewport_size_x);
- viewport.halfsize_y = float24::FromRawFloat24(registers.viewport_size_y);
- viewport.offset_x = float24::FromFloat32(static_cast<float>(registers.viewport_corner.x));
- viewport.offset_y = float24::FromFloat32(static_cast<float>(registers.viewport_corner.y));
- viewport.zscale = float24::FromRawFloat24(registers.viewport_depth_range);
- viewport.offset_z = float24::FromRawFloat24(registers.viewport_depth_far_plane);
+ const auto& regs = g_state.regs;
+ viewport.halfsize_x = float24::FromRawFloat24(regs.viewport_size_x);
+ viewport.halfsize_y = float24::FromRawFloat24(regs.viewport_size_y);
+ viewport.offset_x = float24::FromFloat32(static_cast<float>(regs.viewport_corner.x));
+ viewport.offset_y = float24::FromFloat32(static_cast<float>(regs.viewport_corner.y));
+ viewport.zscale = float24::FromRawFloat24(regs.viewport_depth_range);
+ viewport.offset_z = float24::FromRawFloat24(regs.viewport_depth_far_plane);
float24 inv_w = float24::FromFloat32(1.f) / vtx.pos.w;
vtx.color *= inv_w;