From 54999957a2b861d1597aea47ffdf625fe1006a41 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 4 Jun 2022 17:49:13 +0100 Subject: [PATCH] Remove RGB565 format workaround Will soon be redundant with new texture manager and is quite hacky so drop it. --- app/src/main/cpp/skyline/gpu/presentation_engine.cpp | 4 ---- app/src/main/cpp/skyline/gpu/texture/format.h | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp index bcf8a7e4..bb4e89ac 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp @@ -121,10 +121,6 @@ namespace skyline::gpu { throw exception("Cannot update swapchain to accomodate image extent: {}x{} ({}x{}-{}x{})", extent.width, extent.height, capabilities.minImageExtent.width, capabilities.minImageExtent.height, capabilities.maxImageExtent.width, capabilities.maxImageExtent.height); vk::Format vkFormat{*format}; - if (format == gpu::format::R5G6B5Unorm) - // B5G6R5 isn't generally supported by the swapchain and the format is used for R5G6B5 with swapped R/B channels to avoid aliasing so we reverse that by using R5G6B5 as the underlying Vulkan format for the swapchain which should be automatically handled by the driver for any copies from B5G6R5 textures and the data representation should be the same as B5G6R5 with swapped R/B channels so not reporting the correct texture::Format should be fine - vkFormat = vk::Format::eR5G6B5UnormPack16; - if (swapchainFormat != format) { auto formats{gpu.vkPhysicalDevice.getSurfaceFormatsKHR(**vkSurface)}; if (std::find(formats.begin(), formats.end(), vk::SurfaceFormatKHR{vkFormat, vk::ColorSpaceKHR::eSrgbNonlinear}) == formats.end()) diff --git a/app/src/main/cpp/skyline/gpu/texture/format.h b/app/src/main/cpp/skyline/gpu/texture/format.h index 46a451c2..28404e26 100644 --- a/app/src/main/cpp/skyline/gpu/texture/format.h +++ b/app/src/main/cpp/skyline/gpu/texture/format.h @@ -64,10 +64,7 @@ namespace skyline::gpu::format { FORMAT_NORM_INT_FLOAT(R16, 16, eR16); FORMAT_NORM_INT_SRGB(R8G8, 16, eR8G8); FORMAT(B5G6R5Unorm, 16, eB5G6R5UnormPack16); - FORMAT(R5G6B5Unorm, 16, eB5G6R5UnormPack16, .swizzleMapping = { - .r = vk::ComponentSwizzle::eB, - .b = vk::ComponentSwizzle::eR - }); // Used by SurfaceFlinger + FORMAT(R5G6B5Unorm, 16, eR5G6B5UnormPack16); FORMAT(R4G4B4A4Unorm, 16, eR4G4B4A4UnormPack16, .swizzleMapping = { .r = vk::ComponentSwizzle::eA, .g = vk::ComponentSwizzle::eB,