mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-25 10:36:55 +01:00
Vulkan: Fix incorrect encoding for substituted R4G4 format (#288)
Fixed incorrect channel order when VK_FORMAT_R4G4_UNORM_PACK8 is substituted with VK_FORMAT_R4G4B4A4_UNORM_PACK16
This commit is contained in:
parent
8e89187f95
commit
9caf57c2c5
@ -612,8 +612,8 @@ public:
|
|||||||
uint8* blockData = LatteTextureLoader_GetInput(textureLoader, x, y);
|
uint8* blockData = LatteTextureLoader_GetInput(textureLoader, x, y);
|
||||||
sint32 pixelOffset = (x + yc * textureLoader->width) * 2;
|
sint32 pixelOffset = (x + yc * textureLoader->width) * 2;
|
||||||
uint8 v = (*(uint8*)(blockData + 0));
|
uint8 v = (*(uint8*)(blockData + 0));
|
||||||
*(uint8*)(outputData + pixelOffset + 1) = 0;
|
*(uint8*)(outputData + pixelOffset + 0) = 0;
|
||||||
*(uint8*)(outputData + pixelOffset + 0) = ((v >> 4) & 0xF) | ((v << 4) & 0xF0); // todo: Is this nibble swap correct?
|
*(uint8*)(outputData + pixelOffset + 1) = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2571,7 +2571,7 @@ void VulkanRenderer::GetTextureFormatInfoVK(Latte::E_GX2SURFFMT format, bool isD
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
formatInfoOut->vkImageFormat = VK_FORMAT_R4G4_UNORM_PACK8;
|
formatInfoOut->vkImageFormat = VK_FORMAT_R4G4_UNORM_PACK8;
|
||||||
formatInfoOut->decoder = TextureDecoder_R4_G4::getInstance(); // todo - verify if order of R/G matches between GX2/Vulkan
|
formatInfoOut->decoder = TextureDecoder_R4_G4::getInstance();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// R formats
|
// R formats
|
||||||
|
Loading…
Reference in New Issue
Block a user