From 6c47f02bdfdae7ab4be52104965baa76e256c978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi?= Date: Sat, 16 Nov 2019 19:52:47 +0100 Subject: [PATCH] Fixing OpenGL shader rotation --- gfx/drivers/gl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index c2a57974f2..a0819cf463 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -935,8 +935,14 @@ static void gl2_renderchain_recompute_pass_sizes( break; case RARCH_SCALE_VIEWPORT: - fbo_rect->img_width = fbo_rect->max_img_width = + if (gl->rotation % 180 == 90) + { + fbo_rect->img_width = fbo_rect->max_img_width = + fbo_scale->scale_x * vp_height; + } else { + fbo_rect->img_width = fbo_rect->max_img_width = fbo_scale->scale_x * vp_width; + } break; } @@ -953,8 +959,14 @@ static void gl2_renderchain_recompute_pass_sizes( break; case RARCH_SCALE_VIEWPORT: + if (gl->rotation % 180 == 90) + { + fbo_rect->img_height = fbo_rect->max_img_height = + fbo_scale->scale_y * vp_width; + } else { fbo_rect->img_height = fbo_rect->max_img_height = fbo_scale->scale_y * vp_height; + } break; }