Remove RGB565 format workaround

Will soon be redundant with new texture manager and is quite hacky so drop it.
This commit is contained in:
Billy Laws 2022-06-04 17:49:13 +01:00
parent d79832091d
commit 54999957a2
2 changed files with 1 additions and 8 deletions

View File

@ -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); 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}; 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) { if (swapchainFormat != format) {
auto formats{gpu.vkPhysicalDevice.getSurfaceFormatsKHR(**vkSurface)}; auto formats{gpu.vkPhysicalDevice.getSurfaceFormatsKHR(**vkSurface)};
if (std::find(formats.begin(), formats.end(), vk::SurfaceFormatKHR{vkFormat, vk::ColorSpaceKHR::eSrgbNonlinear}) == formats.end()) if (std::find(formats.begin(), formats.end(), vk::SurfaceFormatKHR{vkFormat, vk::ColorSpaceKHR::eSrgbNonlinear}) == formats.end())

View File

@ -64,10 +64,7 @@ namespace skyline::gpu::format {
FORMAT_NORM_INT_FLOAT(R16, 16, eR16); FORMAT_NORM_INT_FLOAT(R16, 16, eR16);
FORMAT_NORM_INT_SRGB(R8G8, 16, eR8G8); FORMAT_NORM_INT_SRGB(R8G8, 16, eR8G8);
FORMAT(B5G6R5Unorm, 16, eB5G6R5UnormPack16); FORMAT(B5G6R5Unorm, 16, eB5G6R5UnormPack16);
FORMAT(R5G6B5Unorm, 16, eB5G6R5UnormPack16, .swizzleMapping = { FORMAT(R5G6B5Unorm, 16, eR5G6B5UnormPack16);
.r = vk::ComponentSwizzle::eB,
.b = vk::ComponentSwizzle::eR
}); // Used by SurfaceFlinger
FORMAT(R4G4B4A4Unorm, 16, eR4G4B4A4UnormPack16, .swizzleMapping = { FORMAT(R4G4B4A4Unorm, 16, eR4G4B4A4UnormPack16, .swizzleMapping = {
.r = vk::ComponentSwizzle::eA, .r = vk::ComponentSwizzle::eA,
.g = vk::ComponentSwizzle::eB, .g = vk::ComponentSwizzle::eB,