diff options
| author | 2019-12-25 20:03:40 -0300 | |
|---|---|---|
| committer | 2020-02-28 16:48:57 -0300 | |
| commit | f646321dd060572f94c2d4f2f3aa2c5307e21b14 (patch) | |
| tree | 0ca021aecea45371aa5ed3f96003da53c51133ee /src | |
| parent | gl_state: Remove cull mode tracking (diff) | |
| download | yuzu-f646321dd060572f94c2d4f2f3aa2c5307e21b14.tar.gz yuzu-f646321dd060572f94c2d4f2f3aa2c5307e21b14.tar.xz yuzu-f646321dd060572f94c2d4f2f3aa2c5307e21b14.zip | |
gl_state: Remove alpha test tracking
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 1 |
4 files changed, 4 insertions, 21 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a080c3e81..d1034c2a2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1225,12 +1225,10 @@ void RasterizerOpenGL::SyncAlphaTest() { | |||
| 1225 | UNIMPLEMENTED_IF_MSG(regs.alpha_test_enabled != 0 && regs.rt_control.count > 1, | 1225 | UNIMPLEMENTED_IF_MSG(regs.alpha_test_enabled != 0 && regs.rt_control.count > 1, |
| 1226 | "Alpha Testing is enabled with more than one rendertarget"); | 1226 | "Alpha Testing is enabled with more than one rendertarget"); |
| 1227 | 1227 | ||
| 1228 | state.alpha_test.enabled = regs.alpha_test_enabled; | 1228 | oglEnable(GL_ALPHA_TEST, regs.alpha_test_enabled); |
| 1229 | if (!state.alpha_test.enabled) { | 1229 | if (regs.alpha_test_enabled) { |
| 1230 | return; | 1230 | glAlphaFunc(MaxwellToGL::ComparisonOp(regs.alpha_test_func), regs.alpha_test_ref); |
| 1231 | } | 1231 | } |
| 1232 | state.alpha_test.func = MaxwellToGL::ComparisonOp(regs.alpha_test_func); | ||
| 1233 | state.alpha_test.ref = regs.alpha_test_ref; | ||
| 1234 | } | 1232 | } |
| 1235 | 1233 | ||
| 1236 | } // namespace OpenGL | 1234 | } // namespace OpenGL |
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 08e86b599..59fd8e421 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -368,14 +368,6 @@ void OpenGLState::ApplyPolygonOffset() { | |||
| 368 | } | 368 | } |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | void OpenGLState::ApplyAlphaTest() { | ||
| 372 | Enable(GL_ALPHA_TEST, cur_state.alpha_test.enabled, alpha_test.enabled); | ||
| 373 | if (UpdateTie(std::tie(cur_state.alpha_test.func, cur_state.alpha_test.ref), | ||
| 374 | std::tie(alpha_test.func, alpha_test.ref))) { | ||
| 375 | glAlphaFunc(alpha_test.func, alpha_test.ref); | ||
| 376 | } | ||
| 377 | } | ||
| 378 | |||
| 379 | void OpenGLState::ApplyClipControl() { | 371 | void OpenGLState::ApplyClipControl() { |
| 380 | if (UpdateTie(std::tie(cur_state.clip_control.origin, cur_state.clip_control.depth_mode), | 372 | if (UpdateTie(std::tie(cur_state.clip_control.origin, cur_state.clip_control.depth_mode), |
| 381 | std::tie(clip_control.origin, clip_control.depth_mode))) { | 373 | std::tie(clip_control.origin, clip_control.depth_mode))) { |
| @@ -441,7 +433,6 @@ void OpenGLState::Apply() { | |||
| 441 | ApplySamplers(); | 433 | ApplySamplers(); |
| 442 | ApplyImages(); | 434 | ApplyImages(); |
| 443 | ApplyPolygonOffset(); | 435 | ApplyPolygonOffset(); |
| 444 | ApplyAlphaTest(); | ||
| 445 | ApplyClipControl(); | 436 | ApplyClipControl(); |
| 446 | ApplyRenderBuffer(); | 437 | ApplyRenderBuffer(); |
| 447 | } | 438 | } |
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index ae30b9565..f0e02e717 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -133,12 +133,6 @@ public: | |||
| 133 | GLfloat clamp = 0.0f; | 133 | GLfloat clamp = 0.0f; |
| 134 | } polygon_offset; | 134 | } polygon_offset; |
| 135 | 135 | ||
| 136 | struct { | ||
| 137 | bool enabled = false; // GL_ALPHA_TEST | ||
| 138 | GLenum func = GL_ALWAYS; // GL_ALPHA_TEST_FUNC | ||
| 139 | GLfloat ref = 0.0f; // GL_ALPHA_TEST_REF | ||
| 140 | } alpha_test; | ||
| 141 | |||
| 142 | std::array<bool, 8> clip_distance = {}; // GL_CLIP_DISTANCE | 136 | std::array<bool, 8> clip_distance = {}; // GL_CLIP_DISTANCE |
| 143 | 137 | ||
| 144 | struct { | 138 | struct { |
| @@ -182,7 +176,6 @@ public: | |||
| 182 | void ApplyImages(); | 176 | void ApplyImages(); |
| 183 | void ApplyDepthClamp(); | 177 | void ApplyDepthClamp(); |
| 184 | void ApplyPolygonOffset(); | 178 | void ApplyPolygonOffset(); |
| 185 | void ApplyAlphaTest(); | ||
| 186 | void ApplyClipControl(); | 179 | void ApplyClipControl(); |
| 187 | void ApplyRenderBuffer(); | 180 | void ApplyRenderBuffer(); |
| 188 | 181 | ||
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 3d6125dc1..0879a5fb1 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -573,6 +573,7 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x, | |||
| 573 | state.Apply(); | 573 | state.Apply(); |
| 574 | 574 | ||
| 575 | // TODO: Signal state tracker about these changes | 575 | // TODO: Signal state tracker about these changes |
| 576 | glDisable(GL_ALPHA_TEST); | ||
| 576 | glEnable(GL_CULL_FACE); | 577 | glEnable(GL_CULL_FACE); |
| 577 | glCullFace(GL_BACK); | 578 | glCullFace(GL_BACK); |
| 578 | glFrontFace(GL_CW); | 579 | glFrontFace(GL_CW); |