diff options
| author | 2020-06-01 14:04:35 -0400 | |
|---|---|---|
| committer | 2020-06-01 14:04:35 -0400 | |
| commit | 6c0b1a9ee2084bcd553edd823f11648805e4d7b3 (patch) | |
| tree | e1044ad5c9ee440a20613cbca178766500bb7507 /src | |
| parent | Merge pull request #3930 from ReinUsesLisp/animal-borders (diff) | |
| parent | gl_rasterizer: Port front face flip check from Vulkan (diff) | |
| download | yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.gz yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.xz yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.zip | |
Merge pull request #3996 from ReinUsesLisp/front-faces
fixed_pipeline_state,gl_rasterizer: Swap negative viewport checks for front faces
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 25 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 3 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 61cf99b9d..3c421dd16 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1020,6 +1020,26 @@ void RasterizerOpenGL::SyncViewport() { | |||
| 1020 | const auto& regs = gpu.regs; | 1020 | const auto& regs = gpu.regs; |
| 1021 | 1021 | ||
| 1022 | const bool dirty_viewport = flags[Dirty::Viewports]; | 1022 | const bool dirty_viewport = flags[Dirty::Viewports]; |
| 1023 | const bool dirty_clip_control = flags[Dirty::ClipControl]; | ||
| 1024 | |||
| 1025 | if (dirty_clip_control || flags[Dirty::FrontFace]) { | ||
| 1026 | flags[Dirty::FrontFace] = false; | ||
| 1027 | |||
| 1028 | GLenum mode = MaxwellToGL::FrontFace(regs.front_face); | ||
| 1029 | if (regs.screen_y_control.triangle_rast_flip != 0 && | ||
| 1030 | regs.viewport_transform[0].scale_y < 0.0f) { | ||
| 1031 | switch (mode) { | ||
| 1032 | case GL_CW: | ||
| 1033 | mode = GL_CCW; | ||
| 1034 | break; | ||
| 1035 | case GL_CCW: | ||
| 1036 | mode = GL_CW; | ||
| 1037 | break; | ||
| 1038 | } | ||
| 1039 | } | ||
| 1040 | glFrontFace(mode); | ||
| 1041 | } | ||
| 1042 | |||
| 1023 | if (dirty_viewport || flags[Dirty::ClipControl]) { | 1043 | if (dirty_viewport || flags[Dirty::ClipControl]) { |
| 1024 | flags[Dirty::ClipControl] = false; | 1044 | flags[Dirty::ClipControl] = false; |
| 1025 | 1045 | ||
| @@ -1117,11 +1137,6 @@ void RasterizerOpenGL::SyncCullMode() { | |||
| 1117 | glDisable(GL_CULL_FACE); | 1137 | glDisable(GL_CULL_FACE); |
| 1118 | } | 1138 | } |
| 1119 | } | 1139 | } |
| 1120 | |||
| 1121 | if (flags[Dirty::FrontFace]) { | ||
| 1122 | flags[Dirty::FrontFace] = false; | ||
| 1123 | glFrontFace(MaxwellToGL::FrontFace(regs.front_face)); | ||
| 1124 | } | ||
| 1125 | } | 1140 | } |
| 1126 | 1141 | ||
| 1127 | void RasterizerOpenGL::SyncPrimitiveRestart() { | 1142 | void RasterizerOpenGL::SyncPrimitiveRestart() { |
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 568744e3c..424278816 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |||
| @@ -71,8 +71,7 @@ void FixedPipelineState::Rasterizer::Fill(const Maxwell& regs) noexcept { | |||
| 71 | const u32 topology_index = static_cast<u32>(regs.draw.topology.Value()); | 71 | const u32 topology_index = static_cast<u32>(regs.draw.topology.Value()); |
| 72 | 72 | ||
| 73 | u32 packed_front_face = PackFrontFace(regs.front_face); | 73 | u32 packed_front_face = PackFrontFace(regs.front_face); |
| 74 | if (regs.screen_y_control.triangle_rast_flip != 0 && | 74 | if (regs.screen_y_control.triangle_rast_flip != 0) { |
| 75 | regs.viewport_transform[0].scale_y > 0.0f) { | ||
| 76 | // Flip front face | 75 | // Flip front face |
| 77 | packed_front_face = 1 - packed_front_face; | 76 | packed_front_face = 1 - packed_front_face; |
| 78 | } | 77 | } |