Skip to content
Snippets Groups Projects
Unverified Commit bf3c6f88 authored by bunnei's avatar bunnei Committed by GitHub
Browse files

Merge pull request #8149 from liamwhite/front-face

OpenGL: flip front faces if Z scale is inverted
parents 32e2fb5d a5753185
No related branches found
No related tags found
No related merge requests found
...@@ -559,12 +559,19 @@ void RasterizerOpenGL::SyncViewport() { ...@@ -559,12 +559,19 @@ void RasterizerOpenGL::SyncViewport() {
const bool dirty_viewport = flags[Dirty::Viewports] || rescale_viewports; const bool dirty_viewport = flags[Dirty::Viewports] || rescale_viewports;
const bool dirty_clip_control = flags[Dirty::ClipControl]; const bool dirty_clip_control = flags[Dirty::ClipControl];
if (dirty_clip_control || flags[Dirty::FrontFace]) { if (dirty_viewport || dirty_clip_control || flags[Dirty::FrontFace]) {
flags[Dirty::FrontFace] = false; flags[Dirty::FrontFace] = false;
GLenum mode = MaxwellToGL::FrontFace(regs.front_face); GLenum mode = MaxwellToGL::FrontFace(regs.front_face);
bool flip_faces = false;
if (regs.screen_y_control.triangle_rast_flip != 0 && if (regs.screen_y_control.triangle_rast_flip != 0 &&
regs.viewport_transform[0].scale_y < 0.0f) { regs.viewport_transform[0].scale_y < 0.0f) {
flip_faces = !flip_faces;
}
if (regs.viewport_transform[0].scale_z < 0.0f) {
flip_faces = !flip_faces;
}
if (flip_faces) {
switch (mode) { switch (mode) {
case GL_CW: case GL_CW:
mode = GL_CCW; mode = GL_CCW;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment