diff options
| author | 2019-12-25 19:56:17 -0300 | |
|---|---|---|
| committer | 2020-02-28 16:48:23 -0300 | |
| commit | c8f5f54a44e9873134fab74eef97e875b9e6c565 (patch) | |
| tree | cc900a57edeb1f888593a48a743ea553ad5054ec /src | |
| parent | gl_state: Remove front face tracking (diff) | |
| download | yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.gz yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.xz yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.zip | |
gl_state: Remove cull mode tracking
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 2 |
4 files changed, 4 insertions, 19 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e9e9f9794..a080c3e81 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1020,10 +1020,8 @@ void RasterizerOpenGL::SyncClipCoef() { | |||
| 1020 | void RasterizerOpenGL::SyncCullMode() { | 1020 | void RasterizerOpenGL::SyncCullMode() { |
| 1021 | const auto& regs = system.GPU().Maxwell3D().regs; | 1021 | const auto& regs = system.GPU().Maxwell3D().regs; |
| 1022 | 1022 | ||
| 1023 | state.cull.enabled = regs.cull.enabled != 0; | 1023 | oglEnable(GL_CULL_FACE, regs.cull.enabled); |
| 1024 | if (state.cull.enabled) { | 1024 | glCullFace(MaxwellToGL::CullFace(regs.cull.cull_face)); |
| 1025 | state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face); | ||
| 1026 | } | ||
| 1027 | 1025 | ||
| 1028 | glFrontFace(MaxwellToGL::FrontFace(regs.cull.front_face)); | 1026 | glFrontFace(MaxwellToGL::FrontFace(regs.cull.front_face)); |
| 1029 | } | 1027 | } |
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 817676505..08e86b599 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -164,14 +164,6 @@ void OpenGLState::ApplySRgb() { | |||
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | void OpenGLState::ApplyCulling() { | ||
| 168 | Enable(GL_CULL_FACE, cur_state.cull.enabled, cull.enabled); | ||
| 169 | |||
| 170 | if (UpdateValue(cur_state.cull.mode, cull.mode)) { | ||
| 171 | glCullFace(cull.mode); | ||
| 172 | } | ||
| 173 | } | ||
| 174 | |||
| 175 | void OpenGLState::ApplyRasterizerDiscard() { | 167 | void OpenGLState::ApplyRasterizerDiscard() { |
| 176 | Enable(GL_RASTERIZER_DISCARD, cur_state.rasterizer_discard, rasterizer_discard); | 168 | Enable(GL_RASTERIZER_DISCARD, cur_state.rasterizer_discard, rasterizer_discard); |
| 177 | } | 169 | } |
| @@ -441,7 +433,6 @@ void OpenGLState::Apply() { | |||
| 441 | ApplyViewport(); | 433 | ApplyViewport(); |
| 442 | ApplyStencilTest(); | 434 | ApplyStencilTest(); |
| 443 | ApplySRgb(); | 435 | ApplySRgb(); |
| 444 | ApplyCulling(); | ||
| 445 | ApplyDepth(); | 436 | ApplyDepth(); |
| 446 | ApplyPrimitiveRestart(); | 437 | ApplyPrimitiveRestart(); |
| 447 | ApplyBlending(); | 438 | ApplyBlending(); |
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 1b5fde23a..ae30b9565 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -32,11 +32,6 @@ public: | |||
| 32 | } depth_clamp; // GL_DEPTH_CLAMP | 32 | } depth_clamp; // GL_DEPTH_CLAMP |
| 33 | 33 | ||
| 34 | struct { | 34 | struct { |
| 35 | bool enabled = false; // GL_CULL_FACE | ||
| 36 | GLenum mode = GL_BACK; // GL_CULL_FACE_MODE | ||
| 37 | } cull; | ||
| 38 | |||
| 39 | struct { | ||
| 40 | bool test_enabled = false; // GL_DEPTH_TEST | 35 | bool test_enabled = false; // GL_DEPTH_TEST |
| 41 | GLboolean write_mask = GL_TRUE; // GL_DEPTH_WRITEMASK | 36 | GLboolean write_mask = GL_TRUE; // GL_DEPTH_WRITEMASK |
| 42 | GLenum test_func = GL_LESS; // GL_DEPTH_FUNC | 37 | GLenum test_func = GL_LESS; // GL_DEPTH_FUNC |
| @@ -172,7 +167,6 @@ public: | |||
| 172 | void ApplyFragmentColorClamp(); | 167 | void ApplyFragmentColorClamp(); |
| 173 | void ApplyMultisample(); | 168 | void ApplyMultisample(); |
| 174 | void ApplySRgb(); | 169 | void ApplySRgb(); |
| 175 | void ApplyCulling(); | ||
| 176 | void ApplyRasterizerDiscard(); | 170 | void ApplyRasterizerDiscard(); |
| 177 | void ApplyColorMask(); | 171 | void ApplyColorMask(); |
| 178 | void ApplyDepth(); | 172 | void ApplyDepth(); |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 311053695..3d6125dc1 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -573,6 +573,8 @@ 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 | glEnable(GL_CULL_FACE); | ||
| 577 | glCullFace(GL_BACK); | ||
| 576 | glFrontFace(GL_CW); | 578 | glFrontFace(GL_CW); |
| 577 | 579 | ||
| 578 | glNamedBufferSubData(vertex_buffer.handle, 0, sizeof(vertices), std::data(vertices)); | 580 | glNamedBufferSubData(vertex_buffer.handle, 0, sizeof(vertices), std::data(vertices)); |