diff --git a/rpcs3/Emu/GS/GL/GLGSRender.cpp b/rpcs3/Emu/GS/GL/GLGSRender.cpp index ec05c45421..c21170045e 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.cpp +++ b/rpcs3/Emu/GS/GL/GLGSRender.cpp @@ -844,6 +844,7 @@ void GLGSRender::ExecCMD() Enable(m_set_poly_offset_line, GL_POLYGON_OFFSET_LINE); Enable(m_set_poly_offset_point, GL_POLYGON_OFFSET_POINT); Enable(m_set_restart_index, GL_PRIMITIVE_RESTART); + Enable(m_set_line_stipple, GL_LINE_STIPPLE); if(m_set_clip_plane) { @@ -859,7 +860,6 @@ void GLGSRender::ExecCMD() checkForGlError("glEnable"); - if (m_set_front_polygon_mode) { glPolygonMode(GL_FRONT, m_front_polygon_mode); @@ -994,6 +994,12 @@ void GLGSRender::ExecCMD() checkForGlError("glLineWidth"); } + if (m_set_line_stipple) + { + glLineStipple(m_line_stipple_factor, m_line_stipple_pattern); + checkForGlError("glLineStipple"); + } + if(m_set_blend_equation) { glBlendEquationSeparate(m_blend_equation_rgb, m_blend_equation_alpha); diff --git a/rpcs3/Emu/GS/RSXThread.cpp b/rpcs3/Emu/GS/RSXThread.cpp index ff7b473c54..096ef0de48 100644 --- a/rpcs3/Emu/GS/RSXThread.cpp +++ b/rpcs3/Emu/GS/RSXThread.cpp @@ -1441,6 +1441,22 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 } break; + // Line/Polygon Stipple + case NV4097_SET_LINE_STIPPLE: + { + m_set_line_stipple = ARGS(0) ? true : false; + } + break; + + case NV4097_SET_LINE_STIPPLE_PATTERN: + { + m_set_line_stipple = true; + const u32 a0 = ARGS(0); + m_line_stipple_factor = a0 & 0xffff; + m_line_stipple_pattern = a0 >> 16; + } + break; + // Zcull case NV4097_SET_ZCULL_EN: { diff --git a/rpcs3/Emu/GS/RSXThread.h b/rpcs3/Emu/GS/RSXThread.h index 347c2b5fe5..4aa2f71bf0 100644 --- a/rpcs3/Emu/GS/RSXThread.h +++ b/rpcs3/Emu/GS/RSXThread.h @@ -216,6 +216,9 @@ public: bool m_set_poly_offset_mode; float m_poly_offset_scale_factor; float m_poly_offset_bias; + bool m_set_line_stipple; + u16 m_line_stipple_pattern; + u16 m_line_stipple_factor; // Logic Ops bool m_set_logic_op; @@ -437,6 +440,7 @@ protected: m_set_poly_offset_line = false; m_set_poly_offset_point = false; m_set_restart_index = false; + m_set_line_stipple = false; m_clear_color_r = 0; m_clear_color_g = 0; @@ -460,6 +464,8 @@ protected: m_point_y = 0; m_point_size = 1.0; m_line_width = 1.0; + m_line_stipple_pattern = 0x1111; + m_line_stipple_factor = 1; // Construct Textures for(int i=0; i<16; i++) @@ -528,6 +534,7 @@ protected: m_set_restart_index = false; m_set_point_sprite_control = false; m_set_specular = false; + m_set_line_stipple = false; m_clear_surface_mask = 0; m_begin_end = 0;