[Vulkan] Don't allocate textures if we don't know the format.

DTX5A = ATI1
This commit is contained in:
DrChat 2017-12-23 21:02:33 -06:00
parent 1b038125a1
commit 8784daf6bc
1 changed files with 3 additions and 4 deletions

View File

@ -106,7 +106,7 @@ static const TextureConfig texture_configs[64] = {
/* k_11_11_10_AS_16_16_16_16 */ {VK_FORMAT_B10G11R11_UFLOAT_PACK32}, // ?
/* k_32_32_32_FLOAT */ {VK_FORMAT_R32G32B32_SFLOAT},
/* k_DXT3A */ {VK_FORMAT_UNDEFINED},
/* k_DXT5A */ {VK_FORMAT_UNDEFINED},
/* k_DXT5A */ {VK_FORMAT_UNDEFINED}, // ATI1N
// http://fileadmin.cs.lth.se/cs/Personal/Michael_Doggett/talks/unc-xenos-doggett.pdf
/* k_CTX1 */ {VK_FORMAT_R8G8_UINT},
@ -257,9 +257,8 @@ TextureCache::Texture* TextureCache::AllocateTexture(
assert_not_null(texture_info.format_info());
auto& config = texture_configs[int(texture_info.format_info()->format)];
VkFormat format = config.host_format != VK_FORMAT_UNDEFINED
? config.host_format
: VK_FORMAT_R8G8B8A8_UNORM;
VkFormat format = config.host_format;
assert(format != VK_FORMAT_UNDEFINED);
image_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_info.usage =