From 568ba73c71b650f905bd1b3f60f10871316eefdc Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 1 Jan 2025 15:26:48 +1100 Subject: BC4 and BC5 compression --- video.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video.cpp') diff --git a/video.cpp b/video.cpp index 1dc8f68..abcf47d 100644 --- a/video.cpp +++ b/video.cpp @@ -283,6 +283,8 @@ static VkFormat get_vk_format(Texture_Format fmt) { case texture_format_rgba16f: return VK_FORMAT_R16G16B16A16_SFLOAT; case texture_format_rgba32f: return VK_FORMAT_R32G32B32A32_SFLOAT; case texture_format_bc1: return VK_FORMAT_BC1_RGB_UNORM_BLOCK; + case texture_format_bc4: return VK_FORMAT_BC4_UNORM_BLOCK; + case texture_format_bc5: return VK_FORMAT_BC5_UNORM_BLOCK; case texture_format_d16: return VK_FORMAT_D16_UNORM; case texture_format_d24s8: return VK_FORMAT_D24_UNORM_S8_UINT; case texture_format_d32: return VK_FORMAT_D32_SFLOAT; @@ -3633,7 +3635,10 @@ size_t Texture_Loader::calc_size( ) { switch (fmt) { case texture_format_bc1: + case texture_format_bc4: return (w / 4) * (h / 4) * 8; + case texture_format_bc5: + return (w / 4) * (h / 4) * 16; case texture_format_r8i: return w * h; default: -- cgit v1.2.3-54-g00ecf