From 3c5b2d69f6732f9922f6ac2412977d08e6ff96ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 26 Aug 2018 19:26:54 +0200 Subject: [PATCH] Android: When using the hardware scaler, round the size to divisible by 4. Might help #11151 --- android/jni/app-android.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 9206bcd59bb0..1eb3220d8db9 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -871,6 +871,11 @@ void getDesiredBackbufferSize(int &sz_x, int &sz_y) { sz_x = 0; sz_y = 0; } + // Round the size up to the nearest multiple of 4. While this may cause a tiny aspect ratio distortion, + // there's some hope that #11151 is a driver bug that might be worked around this way. If this fixes it, + // it'll be worth trying to round to a multiple of 2 instead. + sz_x = (sz_x + 3) & ~3; + sz_y = (sz_y + 3) & ~3; } extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JNIEnv *, jclass, jint xres, jint yres, jint dpi, jfloat refreshRate) {