aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-11-15 12:09:19 -0500
committerGitHub <noreply@github.com>2019-11-15 12:09:19 -0500
commita8295d2c533d1628887bd45d3bfd8adb66281834 (patch)
treeddfd5d15ff0a055cdd4b4aa5df85c0b2bfc56713 /src/video_core/renderer_opengl/gl_state.cpp
parent3e0e4f146b3f2ad7f1935a61141c38cdce87e04f (diff)
parente9d2fad9849ff7fba8d63a16c838b79a3e752327 (diff)
Merge pull request #3047 from ReinUsesLisp/clip-control
gl_rasterizer: Emulate viewport flipping with ARB_clip_control
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index f25148362..ccbe5912e 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -410,6 +410,12 @@ void OpenGLState::ApplyAlphaTest() {
}
}
+void OpenGLState::ApplyClipControl() {
+ if (UpdateValue(cur_state.clip_control.origin, clip_control.origin)) {
+ glClipControl(clip_control.origin, GL_NEGATIVE_ONE_TO_ONE);
+ }
+}
+
void OpenGLState::ApplyTextures() {
if (const auto update = UpdateArray(cur_state.textures, textures)) {
glBindTextures(update->first, update->second, textures.data() + update->first);
@@ -453,6 +459,7 @@ void OpenGLState::Apply() {
ApplyImages();
ApplyPolygonOffset();
ApplyAlphaTest();
+ ApplyClipControl();
}
void OpenGLState::EmulateViewportWithScissor() {