diff options
author | bunnei <bunneidev@gmail.com> | 2023-06-11 00:13:06 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-11 00:13:06 +0200 |
commit | ea716eb5cc7fd568897da586c1b3aa5c3a5052ba (patch) | |
tree | cfce03591f4582891110bd1148b92ccbbbc8cc28 /src/video_core | |
parent | Merge pull request #10670 from liamwhite/fxaa2 (diff) | |
download | yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.gz yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.bz2 yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.lz yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.xz yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.zst yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_blit_screen.cpp | 47 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_swapchain.cpp | 5 |
2 files changed, 5 insertions, 47 deletions
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index aa8e54bdc..acb143fc7 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp @@ -37,10 +37,6 @@ #include "video_core/vulkan_common/vulkan_memory_allocator.h" #include "video_core/vulkan_common/vulkan_wrapper.h" -#ifdef ANDROID -extern u32 GetAndroidScreenRotation(); -#endif - namespace Vulkan { namespace { @@ -78,47 +74,6 @@ struct ScreenRectVertex { } }; -#ifdef ANDROID - -std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { - constexpr u32 ROTATION_0 = 0; - constexpr u32 ROTATION_90 = 1; - constexpr u32 ROTATION_180 = 2; - constexpr u32 ROTATION_270 = 3; - - // clang-format off - switch (GetAndroidScreenRotation()) { - case ROTATION_0: - // Desktop - return { 2.f / width, 0.f, 0.f, 0.f, - 0.f, 2.f / height, 0.f, 0.f, - 0.f, 0.f, 1.f, 0.f, - -1.f, -1.f, 0.f, 1.f}; - case ROTATION_180: - // Reverse desktop - return {-2.f / width, 0.f, 0.f, 0.f, - 0.f, -2.f / height, 0.f, 0.f, - 0.f, 0.f, 1.f, 0.f, - 1.f, 1.f, 0.f, 1.f}; - case ROTATION_270: - // Reverse landscape - 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}; - case ROTATION_90: - default: - // Landscape - 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}; - } - // clang-format on -} - -#else - std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { // clang-format off return { 2.f / width, 0.f, 0.f, 0.f, @@ -128,8 +83,6 @@ std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { // clang-format on } -#endif - u32 GetBytesPerPixel(const Tegra::FramebufferConfig& framebuffer) { using namespace VideoCore::Surface; return BytesPerBlock(PixelFormatFromGPUPixelFormat(framebuffer.pixel_format)); diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index afcf34fba..d3cddac69 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -231,7 +231,12 @@ void Swapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, bo .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, +#ifdef ANDROID + // On Android, do not allow surface rotation to deviate from the frontend. + .preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, +#else .preTransform = capabilities.currentTransform, +#endif .compositeAlpha = alpha_flags, .presentMode = present_mode, .clipped = VK_FALSE, |