diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-03 02:41:20 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:43 +0100 |
commit | 2eeea907138926e7d712bf20f92c1f3d1cc2d594 (patch) | |
tree | c5086c7c9394ec8a4bccc4957870720f398f28ba /src/video_core/renderer_opengl | |
parent | gl_rasterizer: Disable scissor 0 when scissor is not used on clear (diff) | |
download | yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.tar yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.tar.gz yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.tar.bz2 yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.tar.lz yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.tar.xz yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.tar.zst yuzu-2eeea907138926e7d712bf20f92c1f3d1cc2d594.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 12 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state_tracker.cpp | 5 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state_tracker.h | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e035be867..3ffa9988e 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -493,6 +493,7 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) { SyncFragmentColorClampState(); SyncMultiSampleState(); SyncDepthTestState(); + SyncDepthClamp(); SyncStencilTestState(); SyncBlendState(); SyncLogicOpState(); @@ -967,11 +968,16 @@ void RasterizerOpenGL::SyncViewport() { } void RasterizerOpenGL::SyncDepthClamp() { - const auto& regs = system.GPU().Maxwell3D().regs; - const auto& state = regs.view_volume_clip_control; + auto& gpu = system.GPU().Maxwell3D(); + auto& flags = gpu.dirty.flags; + if (!flags[Dirty::DepthClampEnabled]) { + return; + } + flags[Dirty::DepthClampEnabled] = false; + const auto& state = gpu.regs.view_volume_clip_control; UNIMPLEMENTED_IF_MSG(state.depth_clamp_far != state.depth_clamp_near, - "Unimplemented Depth clamp separation!"); + "Unimplemented depth clamp separation!"); oglEnable(GL_DEPTH_CLAMP, state.depth_clamp_far || state.depth_clamp_near); } diff --git a/src/video_core/renderer_opengl/gl_state_tracker.cpp b/src/video_core/renderer_opengl/gl_state_tracker.cpp index 3d64b1ea4..fa8733028 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.cpp +++ b/src/video_core/renderer_opengl/gl_state_tracker.cpp @@ -217,6 +217,10 @@ void SetupDirtyClipControl(Tables& tables) { table[OFF(depth_mode)] = ClipControl; } +void SetupDirtyDepthClampEnabled(Tables& tables) { + tables[0][OFF(view_volume_clip_control)] = DepthClampEnabled; +} + void SetupDirtyMisc(Tables& tables) { auto& table = tables[0]; @@ -255,6 +259,7 @@ void StateTracker::Initialize() { SetupDirtyFragmentClampColor(tables); SetupDirtyPointSize(tables); SetupDirtyClipControl(tables); + SetupDirtyDepthClampEnabled(tables); SetupDirtyMisc(tables); auto& store = dirty.on_write_stores; diff --git a/src/video_core/renderer_opengl/gl_state_tracker.h b/src/video_core/renderer_opengl/gl_state_tracker.h index a390e0b99..38b38c4a7 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.h +++ b/src/video_core/renderer_opengl/gl_state_tracker.h @@ -75,6 +75,7 @@ enum : u8 { FragmentClampColor, PointSize, ClipControl, + DepthClampEnabled, Last }; |