diff options
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 11 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 3 |
4 files changed, 3 insertions, 29 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 2134d6e4f..b0fb0fb7d 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -872,16 +872,7 @@ public: | |||
| 872 | 872 | ||
| 873 | INSERT_UNION_PADDING_WORDS(0x35); | 873 | INSERT_UNION_PADDING_WORDS(0x35); |
| 874 | 874 | ||
| 875 | union { | 875 | u32 clip_distance_enabled; |
| 876 | BitField<0, 1, u32> c0; | ||
| 877 | BitField<1, 1, u32> c1; | ||
| 878 | BitField<2, 1, u32> c2; | ||
| 879 | BitField<3, 1, u32> c3; | ||
| 880 | BitField<4, 1, u32> c4; | ||
| 881 | BitField<5, 1, u32> c5; | ||
| 882 | BitField<6, 1, u32> c6; | ||
| 883 | BitField<7, 1, u32> c7; | ||
| 884 | } clip_distance_enabled; | ||
| 885 | 876 | ||
| 886 | u32 samplecnt_enable; | 877 | u32 samplecnt_enable; |
| 887 | 878 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index cb3c81398..f4efddcc0 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -969,16 +969,10 @@ void RasterizerOpenGL::SyncDepthClamp() { | |||
| 969 | 969 | ||
| 970 | void RasterizerOpenGL::SyncClipEnabled( | 970 | void RasterizerOpenGL::SyncClipEnabled( |
| 971 | const std::array<bool, Maxwell::Regs::NumClipDistances>& clip_mask) { | 971 | const std::array<bool, Maxwell::Regs::NumClipDistances>& clip_mask) { |
| 972 | |||
| 973 | const auto& regs = system.GPU().Maxwell3D().regs; | 972 | const auto& regs = system.GPU().Maxwell3D().regs; |
| 974 | const std::array<bool, Maxwell::Regs::NumClipDistances> reg_state{ | ||
| 975 | regs.clip_distance_enabled.c0 != 0, regs.clip_distance_enabled.c1 != 0, | ||
| 976 | regs.clip_distance_enabled.c2 != 0, regs.clip_distance_enabled.c3 != 0, | ||
| 977 | regs.clip_distance_enabled.c4 != 0, regs.clip_distance_enabled.c5 != 0, | ||
| 978 | regs.clip_distance_enabled.c6 != 0, regs.clip_distance_enabled.c7 != 0}; | ||
| 979 | |||
| 980 | for (std::size_t i = 0; i < Maxwell::Regs::NumClipDistances; ++i) { | 973 | for (std::size_t i = 0; i < Maxwell::Regs::NumClipDistances; ++i) { |
| 981 | state.clip_distance[i] = reg_state[i] && clip_mask[i]; | 974 | oglEnable(static_cast<GLenum>(GL_CLIP_DISTANCE0 + i), |
| 975 | clip_mask[i] && ((regs.clip_distance_enabled >> i) & 1)); | ||
| 982 | } | 976 | } |
| 983 | } | 977 | } |
| 984 | 978 | ||
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 96c3f40f4..5505fee73 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -106,13 +106,6 @@ void OpenGLState::ApplyProgramPipeline() { | |||
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | void OpenGLState::ApplyClipDistances() { | ||
| 110 | for (std::size_t i = 0; i < clip_distance.size(); ++i) { | ||
| 111 | Enable(GL_CLIP_DISTANCE0 + static_cast<GLenum>(i), cur_state.clip_distance[i], | ||
| 112 | clip_distance[i]); | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | void OpenGLState::ApplyStencilTest() { | 109 | void OpenGLState::ApplyStencilTest() { |
| 117 | Enable(GL_STENCIL_TEST, cur_state.stencil.test_enabled, stencil.test_enabled); | 110 | Enable(GL_STENCIL_TEST, cur_state.stencil.test_enabled, stencil.test_enabled); |
| 118 | 111 | ||
| @@ -249,7 +242,6 @@ void OpenGLState::Apply() { | |||
| 249 | ApplyFramebufferState(); | 242 | ApplyFramebufferState(); |
| 250 | ApplyShaderProgram(); | 243 | ApplyShaderProgram(); |
| 251 | ApplyProgramPipeline(); | 244 | ApplyProgramPipeline(); |
| 252 | ApplyClipDistances(); | ||
| 253 | ApplyStencilTest(); | 245 | ApplyStencilTest(); |
| 254 | ApplyBlending(); | 246 | ApplyBlending(); |
| 255 | ApplyTextures(); | 247 | ApplyTextures(); |
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 6520c88d2..e0bfd16ad 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -54,8 +54,6 @@ public: | |||
| 54 | GLuint program_pipeline = 0; // GL_PROGRAM_PIPELINE_BINDING | 54 | GLuint program_pipeline = 0; // GL_PROGRAM_PIPELINE_BINDING |
| 55 | } draw; | 55 | } draw; |
| 56 | 56 | ||
| 57 | std::array<bool, 8> clip_distance = {}; // GL_CLIP_DISTANCE | ||
| 58 | |||
| 59 | struct { | 57 | struct { |
| 60 | GLenum origin = GL_LOWER_LEFT; | 58 | GLenum origin = GL_LOWER_LEFT; |
| 61 | GLenum depth_mode = GL_NEGATIVE_ONE_TO_ONE; | 59 | GLenum depth_mode = GL_NEGATIVE_ONE_TO_ONE; |
| @@ -76,7 +74,6 @@ public: | |||
| 76 | void ApplyFramebufferState(); | 74 | void ApplyFramebufferState(); |
| 77 | void ApplyShaderProgram(); | 75 | void ApplyShaderProgram(); |
| 78 | void ApplyProgramPipeline(); | 76 | void ApplyProgramPipeline(); |
| 79 | void ApplyClipDistances(); | ||
| 80 | void ApplyStencilTest(); | 77 | void ApplyStencilTest(); |
| 81 | void ApplyTargetBlending(std::size_t target, bool force); | 78 | void ApplyTargetBlending(std::size_t target, bool force); |
| 82 | void ApplyGlobalBlending(); | 79 | void ApplyGlobalBlending(); |