yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

video_core: vk_blit_screen: Rotate viewport for Android landscape.

This commit is contained in:
bunnei 2022-12-17 23:55:05 -08:00
parent cdbab60bbb
commit 18527a8c42
1 changed files with 8 additions and 0 deletions

View File

@ -76,10 +76,18 @@ struct ScreenRectVertex {
constexpr std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { constexpr std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) {
// clang-format off // clang-format off
#ifdef ANDROID
// Android renders in portrait, so rotate the matrix.
return { 0.f, 2.f / width, 0.f, 0.f,
-2.f / height, 0.f, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f,
1.f, -1.f, 0.f, 1.f};
#else
return { 2.f / width, 0.f, 0.f, 0.f, return { 2.f / width, 0.f, 0.f, 0.f,
0.f, 2.f / height, 0.f, 0.f, 0.f, 2.f / height, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f, 0.f,
-1.f, -1.f, 0.f, 1.f}; -1.f, -1.f, 0.f, 1.f};
#endif // ANDROID
// clang-format on // clang-format on
} }