summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_state.h3
3 files changed, 2 insertions, 19 deletions
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() {
void RasterizerOpenGL::SyncClipEnabled(
const std::array<bool, Maxwell::Regs::NumClipDistances>& clip_mask) {
-
const auto& regs = system.GPU().Maxwell3D().regs;
- const std::array<bool, Maxwell::Regs::NumClipDistances> reg_state{
- regs.clip_distance_enabled.c0 != 0, regs.clip_distance_enabled.c1 != 0,
- regs.clip_distance_enabled.c2 != 0, regs.clip_distance_enabled.c3 != 0,
- regs.clip_distance_enabled.c4 != 0, regs.clip_distance_enabled.c5 != 0,
- regs.clip_distance_enabled.c6 != 0, regs.clip_distance_enabled.c7 != 0};
-
for (std::size_t i = 0; i < Maxwell::Regs::NumClipDistances; ++i) {
- state.clip_distance[i] = reg_state[i] && clip_mask[i];
+ oglEnable(static_cast<GLenum>(GL_CLIP_DISTANCE0 + i),
+ clip_mask[i] && ((regs.clip_distance_enabled >> i) & 1));
}
}
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() {
}
}
-void OpenGLState::ApplyClipDistances() {
- for (std::size_t i = 0; i < clip_distance.size(); ++i) {
- Enable(GL_CLIP_DISTANCE0 + static_cast<GLenum>(i), cur_state.clip_distance[i],
- clip_distance[i]);
- }
-}
-
void OpenGLState::ApplyStencilTest() {
Enable(GL_STENCIL_TEST, cur_state.stencil.test_enabled, stencil.test_enabled);
@@ -249,7 +242,6 @@ void OpenGLState::Apply() {
ApplyFramebufferState();
ApplyShaderProgram();
ApplyProgramPipeline();
- ApplyClipDistances();
ApplyStencilTest();
ApplyBlending();
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:
GLuint program_pipeline = 0; // GL_PROGRAM_PIPELINE_BINDING
} draw;
- std::array<bool, 8> clip_distance = {}; // GL_CLIP_DISTANCE
-
struct {
GLenum origin = GL_LOWER_LEFT;
GLenum depth_mode = GL_NEGATIVE_ONE_TO_ONE;
@@ -76,7 +74,6 @@ public:
void ApplyFramebufferState();
void ApplyShaderProgram();
void ApplyProgramPipeline();
- void ApplyClipDistances();
void ApplyStencilTest();
void ApplyTargetBlending(std::size_t target, bool force);
void ApplyGlobalBlending();