mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-24 00:31:52 +01:00
MoltenVk: Workaround for unsupported format R5_G6_B5_UNORM (#318)
This commit is contained in:
parent
cceb4f6d0e
commit
9541c8ae85
@ -1929,6 +1929,13 @@ void VulkanRenderer::QueryAvailableFormats()
|
||||
{
|
||||
m_supportedFormatInfo.fmt_r4g4_unorm_pack = true;
|
||||
}
|
||||
// R5G6B5
|
||||
fmtProp = {};
|
||||
vkGetPhysicalDeviceFormatProperties(m_physical_device, VK_FORMAT_R5G6B5_UNORM_PACK16, &fmtProp);
|
||||
if (fmtProp.optimalTilingFeatures != 0)
|
||||
{
|
||||
m_supportedFormatInfo.fmt_r5g6b5_unorm_pack = true;
|
||||
}
|
||||
// R4G4B4A4
|
||||
fmtProp = {};
|
||||
vkGetPhysicalDeviceFormatProperties(m_physical_device, VK_FORMAT_R4G4B4A4_UNORM_PACK16, &fmtProp);
|
||||
@ -2633,9 +2640,15 @@ void VulkanRenderer::GetTextureFormatInfoVK(Latte::E_GX2SURFFMT format, bool isD
|
||||
break;
|
||||
// special formats
|
||||
case Latte::E_GX2SURFFMT::R5_G6_B5_UNORM:
|
||||
// Vulkan has R in MSB, GPU7 has it in LSB
|
||||
formatInfoOut->vkImageFormat = VK_FORMAT_R5G6B5_UNORM_PACK16;
|
||||
formatInfoOut->decoder = TextureDecoder_R5_G6_B5_swappedRB::getInstance();
|
||||
if (m_supportedFormatInfo.fmt_r5g6b5_unorm_pack == false) {
|
||||
formatInfoOut->vkImageFormat = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
formatInfoOut->decoder = nullptr;
|
||||
}
|
||||
else {
|
||||
// Vulkan has R in MSB, GPU7 has it in LSB
|
||||
formatInfoOut->vkImageFormat = VK_FORMAT_R5G6B5_UNORM_PACK16;
|
||||
formatInfoOut->decoder = TextureDecoder_R5_G6_B5_swappedRB::getInstance();
|
||||
}
|
||||
break;
|
||||
case Latte::E_GX2SURFFMT::R5_G5_B5_A1_UNORM:
|
||||
if (m_supportedFormatInfo.fmt_a1r5g5b5_unorm_pack == false) {
|
||||
|
@ -15,6 +15,7 @@ struct VkSupportedFormatInfo_t
|
||||
{
|
||||
bool fmt_d24_unorm_s8_uint{};
|
||||
bool fmt_r4g4_unorm_pack{};
|
||||
bool fmt_r5g6b5_unorm_pack{};
|
||||
bool fmt_r4g4b4a4_unorm_pack{};
|
||||
bool fmt_a1r5g5b5_unorm_pack{};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user