diff options
author | bunnei <bunneidev@gmail.com> | 2020-06-01 20:04:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 20:04:35 +0200 |
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 yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.gz yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.bz2 yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.lz yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.xz yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.tar.zst yuzu-6c0b1a9ee2084bcd553edd823f11648805e4d7b3.zip |
Diffstat (limited to '')
-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() { const auto& regs = gpu.regs; const bool dirty_viewport = flags[Dirty::Viewports]; + const bool dirty_clip_control = flags[Dirty::ClipControl]; + + if (dirty_clip_control || flags[Dirty::FrontFace]) { + flags[Dirty::FrontFace] = false; + + GLenum mode = MaxwellToGL::FrontFace(regs.front_face); + if (regs.screen_y_control.triangle_rast_flip != 0 && + regs.viewport_transform[0].scale_y < 0.0f) { + switch (mode) { + case GL_CW: + mode = GL_CCW; + break; + case GL_CCW: + mode = GL_CW; + break; + } + } + glFrontFace(mode); + } + if (dirty_viewport || flags[Dirty::ClipControl]) { flags[Dirty::ClipControl] = false; @@ -1117,11 +1137,6 @@ void RasterizerOpenGL::SyncCullMode() { glDisable(GL_CULL_FACE); } } - - if (flags[Dirty::FrontFace]) { - flags[Dirty::FrontFace] = false; - glFrontFace(MaxwellToGL::FrontFace(regs.front_face)); - } } 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 { const u32 topology_index = static_cast<u32>(regs.draw.topology.Value()); u32 packed_front_face = PackFrontFace(regs.front_face); - if (regs.screen_y_control.triangle_rast_flip != 0 && - regs.viewport_transform[0].scale_y > 0.0f) { + if (regs.screen_y_control.triangle_rast_flip != 0) { // Flip front face packed_front_face = 1 - packed_front_face; } |