[Vulkan] Stupid hack to fix ABGR4 formats.

This commit is contained in:
Dr. Chat 2018-05-04 09:45:42 -05:00
parent 7a3d0b683b
commit f54ac240a4
1 changed files with 6 additions and 0 deletions

View File

@ -548,6 +548,12 @@ TextureCache::TextureView* TextureCache::DemandView(Texture* texture,
VK_COMPONENT_SWIZZLE_ZERO, VK_COMPONENT_SWIZZLE_ONE,
VK_COMPONENT_SWIZZLE_IDENTITY,
};
if (texture->texture_info.texture_format == TextureFormat::k_4_4_4_4) {
swiz_component_map[0] = VK_COMPONENT_SWIZZLE_A;
swiz_component_map[1] = VK_COMPONENT_SWIZZLE_B;
swiz_component_map[2] = VK_COMPONENT_SWIZZLE_G;
swiz_component_map[3] = VK_COMPONENT_SWIZZLE_R;
}
view_info.components = {
swiz_component_map[(swizzle >> 0) & 0x7],