summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-07-02 20:33:06 +0200
committerSubv <subv2112@gmail.com>2018-07-02 20:33:06 +0200
commit18c8ae7750d0dac42c94ef41be041aeea6eb2e9e (patch)
treee87502dbc7c76d7f97527b88ba5a5cc9f77f6103 /src/video_core
parentMaxwellToGL: Added conversion functions for depth test and cull mode. (diff)
downloadyuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar
yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.gz
yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.bz2
yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.lz
yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.xz
yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.zst
yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp11
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index b80f4336d..0d0e0653d 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -304,6 +304,9 @@ void RasterizerOpenGL::DrawArrays() {
MICROPROFILE_SCOPE(OpenGL_Drawing);
const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
+ // Sync the depth test state before configuring the framebuffer surfaces.
+ SyncDepthTestState();
+
// TODO(bunnei): Implement these
const bool has_stencil = false;
const bool using_color_fb = true;
@@ -719,6 +722,14 @@ void RasterizerOpenGL::SyncDepthOffset() {
UNREACHABLE();
}
+void RasterizerOpenGL::SyncDepthTestState() {
+ const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
+
+ state.depth.test_enabled = regs.depth_test_enable != 0;
+ state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE;
+ state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func);
+}
+
void RasterizerOpenGL::SyncBlendState() {
const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 621200f03..493aa39e5 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -126,6 +126,9 @@ private:
/// Syncs the depth offset to match the guest state
void SyncDepthOffset();
+ /// Syncs the depth test state to match the guest state
+ void SyncDepthTestState();
+
/// Syncs the blend state to match the guest state
void SyncBlendState();