1// Copyright 2015-2021 The Khronos Group, Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[appendix] 6[[compressed_image_formats]] 7= Compressed Image Formats 8 9The compressed texture formats used by Vulkan are described in the 10specifically identified sections of the <<data-format,Khronos Data Format 11Specification>>, version 1.3. 12 13Unless otherwise described, the quantities encoded in these compressed 14formats are treated as normalized, unsigned values. 15 16Those formats listed as sRGB-encoded have in-memory representations of 17[eq]#R#, [eq]#G# and [eq]#B# components which are nonlinearly-encoded as 18[eq]#R'#, [eq]#G'#, and [eq]#B'#; any alpha component is unchanged. 19As part of filtering, the nonlinear [eq]#R'#, [eq]#G'#, and [eq]#B'# values 20are converted to linear [eq]#R#, [eq]#G#, and [eq]#B# components; any alpha 21component is unchanged. 22The conversion between linear and nonlinear encoding is performed as 23described in the "`KHR_DF_TRANSFER_SRGB`" section of the Khronos Data Format 24Specification. 25 26<<< 27 28[[appendix-compressedtex-bc]] 29== Block-Compressed Image Formats 30 31BC1, BC2 and BC3 formats are described in "`S3TC Compressed Texture Image 32Formats`" chapter of the <<data-format,Khronos Data Format Specification>>. 33BC4 and BC5 are described in the "`RGTC Compressed Texture Image Formats`" 34chapter. 35BC6H and BC7 are described in the "`BPTC Compressed Texture Image Formats`" 36chapter. 37 38.Mapping of Vulkan BC formats to descriptions 39[width="90%",options="header",cols="5,4"] 40|==== 41| elink:VkFormat | <<data-format,Khronos Data Format Specification>> description 422+^| Formats described in the "`S3TC Compressed Texture Image Formats`" chapter 43| ename:VK_FORMAT_BC1_RGB_UNORM_BLOCK |BC1 with no alpha 44| ename:VK_FORMAT_BC1_RGB_SRGB_BLOCK |BC1 with no alpha, sRGB-encoded 45| ename:VK_FORMAT_BC1_RGBA_UNORM_BLOCK|BC1 with alpha 46| ename:VK_FORMAT_BC1_RGBA_SRGB_BLOCK |BC1 with alpha, sRGB-encoded 47| ename:VK_FORMAT_BC2_UNORM_BLOCK |BC2 48| ename:VK_FORMAT_BC2_SRGB_BLOCK |BC2, sRGB-encoded 49| ename:VK_FORMAT_BC3_UNORM_BLOCK |BC3 50| ename:VK_FORMAT_BC3_SRGB_BLOCK |BC3, sRGB-encoded 512+^| Formats described in the "`RGTC Compressed Texture Image Formats`" chapter 52| ename:VK_FORMAT_BC4_UNORM_BLOCK |BC4 unsigned 53| ename:VK_FORMAT_BC4_SNORM_BLOCK |BC4 signed 54| ename:VK_FORMAT_BC5_UNORM_BLOCK |BC5 unsigned 55| ename:VK_FORMAT_BC5_SNORM_BLOCK |BC5 signed 562+^| Formats described in the "`BPTC Compressed Texture Image Formats`" chapter 57| ename:VK_FORMAT_BC6H_UFLOAT_BLOCK |BC6H (unsigned version) 58| ename:VK_FORMAT_BC6H_SFLOAT_BLOCK |BC6H (signed version) 59| ename:VK_FORMAT_BC7_UNORM_BLOCK |BC7 60| ename:VK_FORMAT_BC7_SRGB_BLOCK |BC7, sRGB-encoded 61|==== 62 63<<< 64 65[[appendix-compressedtex-etc2]] 66== ETC Compressed Image Formats 67 68The following formats are described in the "`ETC2 Compressed Texture Image 69Formats`" chapter of the <<data-format,Khronos Data Format Specification>>. 70 71.Mapping of Vulkan ETC formats to descriptions 72[options="header",cols="1,1"] 73|==== 74| elink:VkFormat | <<data-format,Khronos Data Format Specification>> description 75| ename:VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK |RGB ETC2 76| ename:VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK |RGB ETC2 with sRGB encoding 77| ename:VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK |RGB ETC2 with punch-through alpha 78| ename:VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK |RGB ETC2 with punch-through alpha and sRGB 79| ename:VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK |RGBA ETC2 80| ename:VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK |RGBA ETC2 with sRGB encoding 81| ename:VK_FORMAT_EAC_R11_UNORM_BLOCK |Unsigned R11 EAC 82| ename:VK_FORMAT_EAC_R11_SNORM_BLOCK |Signed R11 EAC 83| ename:VK_FORMAT_EAC_R11G11_UNORM_BLOCK |Unsigned RG11 EAC 84| ename:VK_FORMAT_EAC_R11G11_SNORM_BLOCK |Signed RG11 EAC 85|==== 86 87<<< 88 89[[appendix-compressedtex-astc]] 90== ASTC Compressed Image Formats 91 92ASTC formats are described in the "`ASTC Compressed Texture Image Formats`" 93chapter of the <<data-format,Khronos Data Format Specification>>. 94 95.Mapping of Vulkan ASTC formats to descriptions 96[width="90%",options="header",cols="55%,20%,25%"] 97|==== 98| elink:VkFormat ^| Compressed texel block dimensions ^| Requested mode 99| ename:VK_FORMAT_ASTC_4x4_UNORM_BLOCK ^|[eq]#4 {times} 4# ^|Linear LDR 100| ename:VK_FORMAT_ASTC_4x4_SRGB_BLOCK ^|[eq]#4 {times} 4# ^|sRGB 101| ename:VK_FORMAT_ASTC_5x4_UNORM_BLOCK ^|[eq]#5 {times} 4# ^|Linear LDR 102| ename:VK_FORMAT_ASTC_5x4_SRGB_BLOCK ^|[eq]#5 {times} 4# ^|sRGB 103| ename:VK_FORMAT_ASTC_5x5_UNORM_BLOCK ^|[eq]#5 {times} 5# ^|Linear LDR 104| ename:VK_FORMAT_ASTC_5x5_SRGB_BLOCK ^|[eq]#5 {times} 5# ^|sRGB 105| ename:VK_FORMAT_ASTC_6x5_UNORM_BLOCK ^|[eq]#6 {times} 5# ^|Linear LDR 106| ename:VK_FORMAT_ASTC_6x5_SRGB_BLOCK ^|[eq]#6 {times} 5# ^|sRGB 107| ename:VK_FORMAT_ASTC_6x6_UNORM_BLOCK ^|[eq]#6 {times} 6# ^|Linear LDR 108| ename:VK_FORMAT_ASTC_6x6_SRGB_BLOCK ^|[eq]#6 {times} 6# ^|sRGB 109| ename:VK_FORMAT_ASTC_8x5_UNORM_BLOCK ^|[eq]#8 {times} 5# ^|Linear LDR 110| ename:VK_FORMAT_ASTC_8x5_SRGB_BLOCK ^|[eq]#8 {times} 5# ^|sRGB 111| ename:VK_FORMAT_ASTC_8x6_UNORM_BLOCK ^|[eq]#8 {times} 6# ^|Linear LDR 112| ename:VK_FORMAT_ASTC_8x6_SRGB_BLOCK ^|[eq]#8 {times} 6# ^|sRGB 113| ename:VK_FORMAT_ASTC_8x8_UNORM_BLOCK ^|[eq]#8 {times} 8# ^|Linear LDR 114| ename:VK_FORMAT_ASTC_8x8_SRGB_BLOCK ^|[eq]#8 {times} 8# ^|sRGB 115| ename:VK_FORMAT_ASTC_10x5_UNORM_BLOCK ^|[eq]#10 {times} 5# ^|Linear LDR 116| ename:VK_FORMAT_ASTC_10x5_SRGB_BLOCK ^|[eq]#10 {times} 5# ^|sRGB 117| ename:VK_FORMAT_ASTC_10x6_UNORM_BLOCK ^|[eq]#10 {times} 6# ^|Linear LDR 118| ename:VK_FORMAT_ASTC_10x6_SRGB_BLOCK ^|[eq]#10 {times} 6# ^|sRGB 119| ename:VK_FORMAT_ASTC_10x8_UNORM_BLOCK ^|[eq]#10 {times} 8# ^|Linear LDR 120| ename:VK_FORMAT_ASTC_10x8_SRGB_BLOCK ^|[eq]#10 {times} 8# ^|sRGB 121| ename:VK_FORMAT_ASTC_10x10_UNORM_BLOCK ^|[eq]#10 {times} 10# ^|Linear LDR 122| ename:VK_FORMAT_ASTC_10x10_SRGB_BLOCK ^|[eq]#10 {times} 10# ^|sRGB 123| ename:VK_FORMAT_ASTC_12x10_UNORM_BLOCK ^|[eq]#12 {times} 10# ^|Linear LDR 124| ename:VK_FORMAT_ASTC_12x10_SRGB_BLOCK ^|[eq]#12 {times} 10# ^|sRGB 125| ename:VK_FORMAT_ASTC_12x12_UNORM_BLOCK ^|[eq]#12 {times} 12# ^|Linear LDR 126| ename:VK_FORMAT_ASTC_12x12_SRGB_BLOCK ^|[eq]#12 {times} 12# ^|sRGB 127ifdef::VK_EXT_texture_compression_astc_hdr[] 128| ename:VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT ^|[eq]#4 {times} 4# ^|HDR 129| ename:VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT ^|[eq]#5 {times} 4# ^|HDR 130| ename:VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT ^|[eq]#5 {times} 5# ^|HDR 131| ename:VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT ^|[eq]#6 {times} 5# ^|HDR 132| ename:VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT ^|[eq]#6 {times} 6# ^|HDR 133| ename:VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT ^|[eq]#8 {times} 5# ^|HDR 134| ename:VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT ^|[eq]#8 {times} 6# ^|HDR 135| ename:VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT ^|[eq]#8 {times} 8# ^|HDR 136| ename:VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 5# ^|HDR 137| ename:VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 6# ^|HDR 138| ename:VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 8# ^|HDR 139| ename:VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 10# ^|HDR 140| ename:VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT ^|[eq]#12 {times} 10# ^|HDR 141| ename:VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT ^|[eq]#12 {times} 12# ^|HDR 142endif::VK_EXT_texture_compression_astc_hdr[] 143|==== 144 145ifndef::VK_EXT_texture_compression_astc_hdr[] 146ASTC textures containing any HDR blocks should: not be passed into the API 147using an sRGB or UNORM texture format. 148endif::VK_EXT_texture_compression_astc_hdr[] 149ifdef::VK_EXT_texture_compression_astc_hdr[] 150ASTC textures containing HDR block encodings should: be passed to the API 151using an ASTC SFLOAT texture format. 152endif::VK_EXT_texture_compression_astc_hdr[] 153 154[NOTE] 155.Note 156==== 157An HDR block in a texture passed using a LDR UNORM format will return the 158appropriate ASTC error color if the implementation supports only the ASTC 159LDR profile, but may result in either the error color or a decompressed HDR 160color if the implementation supports HDR decoding. 161==== 162 163ifdef::VK_EXT_astc_decode_mode[] 164 165=== ASTC decode mode 166 167If the `VK_EXT_astc_decode_mode` extension is enabled, the decode mode is 168determined as follows: 169 170.Mapping of Vulkan ASTC decoding format to ASTC decoding modes 171[width="75%",options="header",cols="75%,25%"] 172|==== 173| elink:VkFormat ^| Decoding mode 174| ename:VK_FORMAT_R16G16B16A16_SFLOAT ^| decode_float16 175| ename:VK_FORMAT_R8G8B8A8_UNORM ^| decode_unorm8 176| ename:VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ^| decode_rgb9e5 177|==== 178 179Otherwise, the ASTC decode mode is decode_float16. 180 181Note that an implementation may: use HDR mode when linear LDR mode is 182requested unless the decode mode is decode_unorm8. 183endif::VK_EXT_astc_decode_mode[] 184ifndef::VK_EXT_astc_decode_mode[] 185The ASTC decode mode is decode_float16. 186 187Note that an implementation may: use HDR mode when linear LDR mode is 188requested. 189endif::VK_EXT_astc_decode_mode[] 190 191ifdef::VK_IMG_format_pvrtc[] 192<<< 193 194[[appendix-compressedtex-pvrtc]] 195== PVRTC Compressed Image Formats 196 197PVRTC formats are described in the "`PVRTC Compressed Texture Image 198Formats`" chapter of the <<data-format,Khronos Data Format Specification>>. 199 200.Mapping of Vulkan PVRTC formats to descriptions 201[width="75%",options="header",cols="63%,15%,22%"] 202|==== 203| elink:VkFormat ^| Compressed texel block dimensions ^| sRGB-encoded 204| ename:VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG ^|[eq]#8 {times} 4# ^|No 205| ename:VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG ^|[eq]#4 {times} 4# ^|No 206| ename:VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG ^|[eq]#8 {times} 4# ^|No 207| ename:VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG ^|[eq]#4 {times} 4# ^|No 208| ename:VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG ^|[eq]#8 {times} 4# ^|Yes 209| ename:VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG ^|[eq]#4 {times} 4# ^|Yes 210| ename:VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG ^|[eq]#8 {times} 4# ^|Yes 211| ename:VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG ^|[eq]#4 {times} 4# ^|Yes 212|==== 213endif::VK_IMG_format_pvrtc[] 214