summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-30 05:40:27 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 21:56:42 +0100
commita42a6e1a2c41b59a779d92a94123f38d88c3fec3 (patch)
tree47b53ff043d88de50ae4a2c40d2adb5e976a751b /src/video_core/renderer_opengl/gl_rasterizer.cpp
parentgl_state_tracker: Implement dirty flags for point sizes (diff)
downloadyuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.tar
yuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.tar.gz
yuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.tar.bz2
yuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.tar.lz
yuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.tar.xz
yuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.tar.zst
yuzu-a42a6e1a2c41b59a779d92a94123f38d88c3fec3.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index ec1936927..133ac6c0f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -460,7 +460,6 @@ void RasterizerOpenGL::Clear() {
// TODO: Signal state tracker about these changes
state_tracker.NotifyBlend0();
// TODO(Rodrigo): Find out if these changes affect clearing
- glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
glDisablei(GL_BLEND, 0);
UNIMPLEMENTED_IF(regs.clear_flags.viewport);
@@ -927,7 +926,23 @@ void RasterizerOpenGL::SyncViewport() {
auto& flags = gpu.dirty.flags;
const auto& regs = gpu.regs;
- if (flags[Dirty::Viewports]) {
+ const bool dirty_viewport = flags[Dirty::Viewports];
+ if (dirty_viewport || flags[Dirty::ClipControl]) {
+ flags[Dirty::ClipControl] = false;
+
+ bool flip_y = false;
+ if (regs.viewport_transform[0].scale_y < 0.0) {
+ flip_y = !flip_y;
+ }
+ if (regs.screen_y_control.y_negate != 0) {
+ flip_y = !flip_y;
+ }
+ glClipControl(flip_y ? GL_UPPER_LEFT : GL_LOWER_LEFT,
+ regs.depth_mode == Maxwell::DepthMode::ZeroToOne ? GL_ZERO_TO_ONE
+ : GL_NEGATIVE_ONE_TO_ONE);
+ }
+
+ if (dirty_viewport) {
flags[Dirty::Viewports] = false;
const bool force = flags[Dirty::ViewportTransform];
@@ -948,17 +963,6 @@ void RasterizerOpenGL::SyncViewport() {
static_cast<GLdouble>(src.depth_range_far));
}
}
-
- bool flip_y = false;
- if (regs.viewport_transform[0].scale_y < 0.0) {
- flip_y = !flip_y;
- }
- if (regs.screen_y_control.y_negate != 0) {
- flip_y = !flip_y;
- }
- glClipControl(flip_y ? GL_UPPER_LEFT : GL_LOWER_LEFT,
- regs.depth_mode == Maxwell::DepthMode::ZeroToOne ? GL_ZERO_TO_ONE
- : GL_NEGATIVE_ONE_TO_ONE);
}
void RasterizerOpenGL::SyncDepthClamp() {