mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-24 04:16:24 -05:00
gl_rasterizer: Flip triangles when regs.viewport_transform[0].scale_y is negative.
- Fixes a regression with Binding of Isaac.
This commit is contained in:
parent
639346bcfb
commit
854f474f52
1 changed files with 4 additions and 1 deletions
|
@ -775,10 +775,13 @@ void RasterizerOpenGL::SyncCullMode() {
|
||||||
state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face);
|
state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face);
|
||||||
state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face);
|
state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face);
|
||||||
|
|
||||||
|
const bool flip_triangles{regs.screen_y_control.triangle_rast_flip == 0 ||
|
||||||
|
regs.viewport_transform[0].scale_y < 0.0f};
|
||||||
|
|
||||||
// If the GPU is configured to flip the rasterized triangles, then we need to flip the
|
// If the GPU is configured to flip the rasterized triangles, then we need to flip the
|
||||||
// notion of front and back. Note: We flip the triangles when the value of the register is 0
|
// notion of front and back. Note: We flip the triangles when the value of the register is 0
|
||||||
// because OpenGL already does it for us.
|
// because OpenGL already does it for us.
|
||||||
if (regs.screen_y_control.triangle_rast_flip == 0) {
|
if (flip_triangles) {
|
||||||
if (state.cull.front_face == GL_CCW)
|
if (state.cull.front_face == GL_CCW)
|
||||||
state.cull.front_face = GL_CW;
|
state.cull.front_face = GL_CW;
|
||||||
else if (state.cull.front_face == GL_CW)
|
else if (state.cull.front_face == GL_CW)
|
||||||
|
|
Loading…
Reference in a new issue