From 1923b7a7c4bef1555430a4474591d75960a1959b Mon Sep 17 00:00:00 2001 From: rcaridade145 Date: Sun, 12 Jan 2025 11:37:56 +0000 Subject: [PATCH] Vulkan: Added R5_G6_B5_UNORM to supported readback formats (#1430) --- src/Cafe/HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp index b055fe7eb..bce23b597 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/TextureReadbackVk.cpp @@ -22,7 +22,7 @@ uint32 LatteTextureReadbackInfoVk::GetImageSize(LatteTextureView* textureView) cemu_assert(textureFormat == VK_FORMAT_R8G8B8A8_UNORM); return baseTexture->width * baseTexture->height * 4; } - else if (textureView->format == Latte::E_GX2SURFFMT::R8_UNORM) + else if (textureView->format == Latte::E_GX2SURFFMT::R8_UNORM ) { cemu_assert(textureFormat == VK_FORMAT_R8_UNORM); return baseTexture->width * baseTexture->height * 1; @@ -79,6 +79,13 @@ uint32 LatteTextureReadbackInfoVk::GetImageSize(LatteTextureView* textureView) // todo - if driver does not support VK_FORMAT_D24_UNORM_S8_UINT this is represented as VK_FORMAT_D32_SFLOAT_S8_UINT which is 8 bytes return baseTexture->width * baseTexture->height * 4; } + else if (textureView->format == Latte::E_GX2SURFFMT::R5_G6_B5_UNORM ) + { + if(textureFormat == VK_FORMAT_R5G6B5_UNORM_PACK16){ + return baseTexture->width * baseTexture->height * 2; + } + return 0; + } else { cemuLog_log(LogType::Force, "Unsupported texture readback format {:04x}", (uint32)textureView->format);