diff options
| author | 2018-07-02 23:47:11 -0400 | |
|---|---|---|
| committer | 2018-07-02 23:47:11 -0400 | |
| commit | ddb767f1b6b5643a08b8f51d4f3d7f8cb83aa134 (patch) | |
| tree | ccd1711253e0bf2e10e62df4b72afb345a605ce5 /src | |
| parent | Merge pull request #610 from Subv/mufu_8 (diff) | |
| parent | GPU: Use only the least significant 3 bits when reading the depth test func. (diff) | |
| download | yuzu-ddb767f1b6b5643a08b8f51d4f3d7f8cb83aa134.tar.gz yuzu-ddb767f1b6b5643a08b8f51d4f3d7f8cb83aa134.tar.xz yuzu-ddb767f1b6b5643a08b8f51d4f3d7f8cb83aa134.zip | |
Merge pull request #611 from Subv/enabled_depth_test
GPU: Don't try to parse the depth test function if the depth test is disabled and use only the least significant 3 bits in the depth test func
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 18 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index ff67f2a58..12aec3549 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -281,14 +281,14 @@ public: | |||
| 281 | }; | 281 | }; |
| 282 | 282 | ||
| 283 | enum class ComparisonOp : u32 { | 283 | enum class ComparisonOp : u32 { |
| 284 | Never = 0x200, | 284 | Never = 0, |
| 285 | Less = 0x201, | 285 | Less = 1, |
| 286 | Equal = 0x202, | 286 | Equal = 2, |
| 287 | LessEqual = 0x203, | 287 | LessEqual = 3, |
| 288 | Greater = 0x204, | 288 | Greater = 4, |
| 289 | NotEqual = 0x205, | 289 | NotEqual = 5, |
| 290 | GreaterEqual = 0x206, | 290 | GreaterEqual = 6, |
| 291 | Always = 0x207, | 291 | Always = 7, |
| 292 | }; | 292 | }; |
| 293 | 293 | ||
| 294 | struct Cull { | 294 | struct Cull { |
| @@ -475,7 +475,7 @@ public: | |||
| 475 | 475 | ||
| 476 | INSERT_PADDING_WORDS(0x8); | 476 | INSERT_PADDING_WORDS(0x8); |
| 477 | 477 | ||
| 478 | ComparisonOp depth_test_func; | 478 | BitField<0, 3, ComparisonOp> depth_test_func; |
| 479 | 479 | ||
| 480 | INSERT_PADDING_WORDS(0xB); | 480 | INSERT_PADDING_WORDS(0xB); |
| 481 | 481 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index ca3814cfc..1ced31e84 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -735,6 +735,10 @@ void RasterizerOpenGL::SyncDepthTestState() { | |||
| 735 | 735 | ||
| 736 | state.depth.test_enabled = regs.depth_test_enable != 0; | 736 | state.depth.test_enabled = regs.depth_test_enable != 0; |
| 737 | state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE; | 737 | state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE; |
| 738 | |||
| 739 | if (!state.depth.test_enabled) | ||
| 740 | return; | ||
| 741 | |||
| 738 | state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func); | 742 | state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func); |
| 739 | } | 743 | } |
| 740 | 744 | ||