summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-12-26 02:27:26 -0300
committerGravatar ReinUsesLisp2020-02-28 17:31:57 -0300
commit07a954e67f786fad4b6324837489af705788a6b9 (patch)
treec2ba642a02d4f31526854abd679c3b773f67d9f0
parentgl_state: Remove clip distances tracking (diff)
downloadyuzu-07a954e67f786fad4b6324837489af705788a6b9.tar.gz
yuzu-07a954e67f786fad4b6324837489af705788a6b9.tar.xz
yuzu-07a954e67f786fad4b6324837489af705788a6b9.zip
gl_state: Remove clip control tracking
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp11
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_state.h6
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp1
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp1
5 files changed, 8 insertions, 19 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index f4efddcc0..8f9bb4c93 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -467,6 +467,9 @@ void RasterizerOpenGL::Clear() {
467 SyncScissorTest(); 467 SyncScissorTest();
468 } 468 }
469 469
470 // TODO: Signal state tracker about these changes
471 glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
472
470 UNIMPLEMENTED_IF(regs.clear_flags.viewport); 473 UNIMPLEMENTED_IF(regs.clear_flags.viewport);
471 474
472 clear_state.Apply(); 475 clear_state.Apply();
@@ -950,11 +953,9 @@ void RasterizerOpenGL::SyncViewport() {
950 if (regs.screen_y_control.y_negate != 0) { 953 if (regs.screen_y_control.y_negate != 0) {
951 flip_y = !flip_y; 954 flip_y = !flip_y;
952 } 955 }
953 state.clip_control.origin = flip_y ? GL_UPPER_LEFT : GL_LOWER_LEFT; 956 glClipControl(flip_y ? GL_UPPER_LEFT : GL_LOWER_LEFT,
954 state.clip_control.depth_mode = 957 regs.depth_mode == Maxwell::DepthMode::ZeroToOne ? GL_ZERO_TO_ONE
955 regs.depth_mode == Tegra::Engines::Maxwell3D::Regs::DepthMode::ZeroToOne 958 : GL_NEGATIVE_ONE_TO_ONE);
956 ? GL_ZERO_TO_ONE
957 : GL_NEGATIVE_ONE_TO_ONE;
958} 959}
959 960
960void RasterizerOpenGL::SyncDepthClamp() { 961void RasterizerOpenGL::SyncDepthClamp() {
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 5505fee73..69a8a4eb1 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -195,13 +195,6 @@ void OpenGLState::ApplyBlending() {
195 cur_state.independant_blend.enabled = independant_blend.enabled; 195 cur_state.independant_blend.enabled = independant_blend.enabled;
196} 196}
197 197
198void OpenGLState::ApplyClipControl() {
199 if (UpdateTie(std::tie(cur_state.clip_control.origin, cur_state.clip_control.depth_mode),
200 std::tie(clip_control.origin, clip_control.depth_mode))) {
201 glClipControl(clip_control.origin, clip_control.depth_mode);
202 }
203}
204
205void OpenGLState::ApplyRenderBuffer() { 198void OpenGLState::ApplyRenderBuffer() {
206 if (cur_state.renderbuffer != renderbuffer) { 199 if (cur_state.renderbuffer != renderbuffer) {
207 cur_state.renderbuffer = renderbuffer; 200 cur_state.renderbuffer = renderbuffer;
@@ -247,7 +240,6 @@ void OpenGLState::Apply() {
247 ApplyTextures(); 240 ApplyTextures();
248 ApplySamplers(); 241 ApplySamplers();
249 ApplyImages(); 242 ApplyImages();
250 ApplyClipControl();
251 ApplyRenderBuffer(); 243 ApplyRenderBuffer();
252} 244}
253 245
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index e0bfd16ad..6ea625c56 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -54,11 +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 struct {
58 GLenum origin = GL_LOWER_LEFT;
59 GLenum depth_mode = GL_NEGATIVE_ONE_TO_ONE;
60 } clip_control;
61
62 GLuint renderbuffer{}; // GL_RENDERBUFFER_BINDING 57 GLuint renderbuffer{}; // GL_RENDERBUFFER_BINDING
63 58
64 OpenGLState(); 59 OpenGLState();
@@ -81,7 +76,6 @@ public:
81 void ApplyTextures(); 76 void ApplyTextures();
82 void ApplySamplers(); 77 void ApplySamplers();
83 void ApplyImages(); 78 void ApplyImages();
84 void ApplyClipControl();
85 void ApplyRenderBuffer(); 79 void ApplyRenderBuffer();
86 80
87 /// Resets any references to the given resource 81 /// Resets any references to the given resource
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index ed2daf74c..85d41f826 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -539,6 +539,7 @@ void TextureCacheOpenGL::ImageBlit(View& src_view, View& dst_view,
539 // TODO(Rodrigo): Find out if rasterizer discard affects blits 539 // TODO(Rodrigo): Find out if rasterizer discard affects blits
540 glDisable(GL_RASTERIZER_DISCARD); 540 glDisable(GL_RASTERIZER_DISCARD);
541 glDisablei(GL_SCISSOR_TEST, 0); 541 glDisablei(GL_SCISSOR_TEST, 0);
542 glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
542 543
543 u32 buffers{}; 544 u32 buffers{};
544 545
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index d18adaddc..a4cf6a489 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -585,6 +585,7 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
585 glCullFace(GL_BACK); 585 glCullFace(GL_BACK);
586 glFrontFace(GL_CW); 586 glFrontFace(GL_CW);
587 glColorMaski(0, GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 587 glColorMaski(0, GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
588 glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
588 glViewport(0, 0, layout.width, layout.height); 589 glViewport(0, 0, layout.width, layout.height);
589 590
590 glVertexAttribFormat(PositionLocation, 2, GL_FLOAT, GL_FALSE, 591 glVertexAttribFormat(PositionLocation, 2, GL_FLOAT, GL_FALSE,