diff options
author | tfarley <tfarleygithub@gmail.com> | 2016-01-04 00:46:54 +0100 |
---|---|---|
committer | tfarley <tfarleygithub@gmail.com> | 2016-01-21 03:57:59 +0100 |
commit | f53dbafdae6b6ca8ab718d2299437df469441389 (patch) | |
tree | ddf1b234c2440f8ade62be48ddf1e32ee22c8801 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #1327 from Subv/unmap_memblock (diff) | |
download | yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.tar yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.tar.gz yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.tar.bz2 yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.tar.lz yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.tar.xz yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.tar.zst yuzu-f53dbafdae6b6ca8ab718d2299437df469441389.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 092351dce..291ef737d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -126,6 +126,7 @@ void RasterizerOpenGL::InitObjects() { void RasterizerOpenGL::Reset() { SyncCullMode(); + SyncDepthModifiers(); SyncBlendEnabled(); SyncBlendFuncs(); SyncBlendColor(); @@ -194,6 +195,12 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) { SyncCullMode(); break; + // Depth modifiers + case PICA_REG_INDEX(viewport_depth_range): + case PICA_REG_INDEX(viewport_depth_far_plane): + SyncDepthModifiers(); + break; + // Blending case PICA_REG_INDEX(output_merger.alphablend_enable): SyncBlendEnabled(); @@ -602,6 +609,15 @@ void RasterizerOpenGL::SyncCullMode() { } } +void RasterizerOpenGL::SyncDepthModifiers() { + float depth_scale = -Pica::float24::FromRawFloat24(Pica::g_state.regs.viewport_depth_range).ToFloat32(); + float depth_offset = Pica::float24::FromRawFloat24(Pica::g_state.regs.viewport_depth_far_plane).ToFloat32() / 2.0f; + + // TODO: Implement scale modifier + uniform_block_data.data.depth_offset = depth_offset; + uniform_block_data.dirty = true; +} + void RasterizerOpenGL::SyncBlendEnabled() { state.blend.enabled = (Pica::g_state.regs.output_merger.alphablend_enable == 1); } |