From 69c806feb631509fac804ac2677b3787d883cf75 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 1 Oct 2019 02:00:23 -0300 Subject: gl_rasterizer: Fix polygon offset units For some reason hardware divides polygon offset units by two. This is visible since drivers multiply the application requested polygon offset by two. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 6a17bed72..a85f730a8 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1340,7 +1340,9 @@ void RasterizerOpenGL::SyncPolygonOffset() { state.polygon_offset.fill_enable = regs.polygon_offset_fill_enable != 0; state.polygon_offset.line_enable = regs.polygon_offset_line_enable != 0; state.polygon_offset.point_enable = regs.polygon_offset_point_enable != 0; - state.polygon_offset.units = regs.polygon_offset_units; + + // Hardware divides polygon offset units by two + state.polygon_offset.units = regs.polygon_offset_units / 2.0f; state.polygon_offset.factor = regs.polygon_offset_factor; state.polygon_offset.clamp = regs.polygon_offset_clamp; -- cgit v1.2.3