diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index bb09ecd52..01d89f47d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -537,8 +537,7 @@ std::pair<bool, bool> RasterizerOpenGL::ConfigureFramebuffers( | |||
| 537 | texture_cache.MarkDepthBufferInUse(); | 537 | texture_cache.MarkDepthBufferInUse(); |
| 538 | 538 | ||
| 539 | fbkey.zeta = depth_surface; | 539 | fbkey.zeta = depth_surface; |
| 540 | fbkey.stencil_enable = regs.stencil_enable && | 540 | fbkey.stencil_enable = depth_surface->GetSurfaceParams().type == SurfaceType::DepthStencil; |
| 541 | depth_surface->GetSurfaceParams().type == SurfaceType::DepthStencil; | ||
| 542 | } | 541 | } |
| 543 | 542 | ||
| 544 | texture_cache.GuardRenderTargets(false); | 543 | texture_cache.GuardRenderTargets(false); |
| @@ -577,16 +576,15 @@ void RasterizerOpenGL::ConfigureClearFramebuffer(OpenGLState& current_state, boo | |||
| 577 | if (depth_surface) { | 576 | if (depth_surface) { |
| 578 | const auto& params = depth_surface->GetSurfaceParams(); | 577 | const auto& params = depth_surface->GetSurfaceParams(); |
| 579 | switch (params.type) { | 578 | switch (params.type) { |
| 580 | case VideoCore::Surface::SurfaceType::Depth: { | 579 | case VideoCore::Surface::SurfaceType::Depth: |
| 581 | depth_surface->Attach(GL_DEPTH_ATTACHMENT, GL_DRAW_FRAMEBUFFER); | 580 | depth_surface->Attach(GL_DEPTH_ATTACHMENT, GL_DRAW_FRAMEBUFFER); |
| 582 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); | 581 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); |
| 583 | break; | 582 | break; |
| 584 | } | 583 | case VideoCore::Surface::SurfaceType::DepthStencil: |
| 585 | case VideoCore::Surface::SurfaceType::DepthStencil: { | 584 | depth_surface->Attach(GL_DEPTH_STENCIL_ATTACHMENT, GL_DRAW_FRAMEBUFFER); |
| 586 | depth_surface->Attach(GL_DEPTH_ATTACHMENT, GL_DRAW_FRAMEBUFFER); | ||
| 587 | break; | 585 | break; |
| 588 | } | 586 | default: |
| 589 | default: { UNIMPLEMENTED(); } | 587 | UNIMPLEMENTED(); |
| 590 | } | 588 | } |
| 591 | } else { | 589 | } else { |
| 592 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, | 590 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, |
| @@ -639,6 +637,7 @@ void RasterizerOpenGL::Clear() { | |||
| 639 | ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear stencil but buffer is not enabled!"); | 637 | ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear stencil but buffer is not enabled!"); |
| 640 | use_stencil = true; | 638 | use_stencil = true; |
| 641 | clear_state.stencil.test_enabled = true; | 639 | clear_state.stencil.test_enabled = true; |
| 640 | |||
| 642 | if (regs.clear_flags.stencil) { | 641 | if (regs.clear_flags.stencil) { |
| 643 | // Stencil affects the clear so fill it with the used masks | 642 | // Stencil affects the clear so fill it with the used masks |
| 644 | clear_state.stencil.front.test_func = GL_ALWAYS; | 643 | clear_state.stencil.front.test_func = GL_ALWAYS; |
| @@ -1119,9 +1118,12 @@ void RasterizerOpenGL::SyncStencilTestState() { | |||
| 1119 | if (!maxwell3d.dirty.stencil_test) { | 1118 | if (!maxwell3d.dirty.stencil_test) { |
| 1120 | return; | 1119 | return; |
| 1121 | } | 1120 | } |
| 1122 | const auto& regs = maxwell3d.regs; | 1121 | maxwell3d.dirty.stencil_test = false; |
| 1123 | 1122 | ||
| 1123 | const auto& regs = maxwell3d.regs; | ||
| 1124 | state.stencil.test_enabled = regs.stencil_enable != 0; | 1124 | state.stencil.test_enabled = regs.stencil_enable != 0; |
| 1125 | state.MarkDirtyStencilState(); | ||
| 1126 | |||
| 1125 | if (!regs.stencil_enable) { | 1127 | if (!regs.stencil_enable) { |
| 1126 | return; | 1128 | return; |
| 1127 | } | 1129 | } |
| @@ -1150,8 +1152,6 @@ void RasterizerOpenGL::SyncStencilTestState() { | |||
| 1150 | state.stencil.back.action_depth_fail = GL_KEEP; | 1152 | state.stencil.back.action_depth_fail = GL_KEEP; |
| 1151 | state.stencil.back.action_depth_pass = GL_KEEP; | 1153 | state.stencil.back.action_depth_pass = GL_KEEP; |
| 1152 | } | 1154 | } |
| 1153 | state.MarkDirtyStencilState(); | ||
| 1154 | maxwell3d.dirty.stencil_test = false; | ||
| 1155 | } | 1155 | } |
| 1156 | 1156 | ||
| 1157 | void RasterizerOpenGL::SyncColorMask() { | 1157 | void RasterizerOpenGL::SyncColorMask() { |