Vulkan-Docs/appendices/compressedtex.txt
Jon Leech 194a7f4d0d Change log for September 8, 2019 Vulkan 1.1.122 spec update:
* Update release number to 122.

Internal Issues:

  * Add style guide language on not using standalone `+` signs (internal
    issue 736); not using leading whitespace for markup (internal issue
    747); and on keeping descriptions of a single API in a contiguous block
    of markup (internal issue 949), and apply them to the specification.
  * Add a glossary definition of "`constant integral expression`", pointing
    to the SPIR-V "`constant instruction`" definition (internal issue 1225).
  * Many minor edits to improve writing style consistency and capture
    additional style guidelines (internal issue 1553).
  * Clarify that <<fragops-depth-write, depth writes are not performed>> if
    there is no depth framebuffer attachment (internal issue 1771).
  * Allow implementations to use rectangular line style of interpolation for
    <<primsrast-lines-bresenham, wide Bresenham lines>>, though replicating
    attributes is still preferred. Clarify that code:FragCoord is not
    replicated (internal issue 1772).
  * Resolve a contradiction in valid usage statements for
    slink:VkImageCreateInfo and slink:VkImageStencilUsageCreateInfoEXT
    (internal issue 1773).
  * Add style guide discussion of markup for indented equations, and use
    markup workaround for asciidoctor 2 compatibility (internal issue 1793).
  * Deprecate the `<<VK_EXT_validation_flags>>` extension in `vk.xml` and
    the extension appendix (internal issue 1801).
  * Add a new checker script `scripts/xml_consistency.py`. This is not
    currently run as part of internal CI (internal merge request 3285).
  * Correct "`an`" -> "`a`" prepositions where needed (internal merge
    request 3334).
  * Clarify that the <<features-uniformBufferStandardLayout,
    pname:uniformBufferStandardLayout>> feature is only required when the
    extension defining it is supported (internal merge request 3341).
  * Bring scripts into closer sync with OpenXR, mainly through conversion of
    comments to docstrings where appropriate, and add gen-scripts-docs.sh
    (internal merge request 3324).
  * Correct pname:maxDrawMeshTasksCount to 2^16^-1 in the <<limits-required,
    Required Limits>> table (internal merge requests 3361).

New Extensions

  * `<<VK_IMG_format_pvrtc>>` (public issue 512).
2019-09-08 20:41:02 -07:00

179 lines
8.8 KiB
Plaintext

// Copyright (c) 2015-2019 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
[appendix]
= Compressed Image Formats
The compressed texture formats used by Vulkan are described in the
specifically identified sections of the <<data-format,Khronos Data Format
Specification>>, version 1.1.
Unless otherwise described, the quantities encoded in these compressed
formats are treated as normalized, unsigned values.
Those formats listed as sRGB-encoded have in-memory representations of
[eq]#R#, [eq]#G# and [eq]#B# components which are nonlinearly-encoded as
[eq]#R'#, [eq]#G'#, and [eq]#B'#; any alpha component is unchanged.
As part of filtering, the nonlinear [eq]#R'#, [eq]#G'#, and [eq]#B'# values
are converted to linear [eq]#R#, [eq]#G#, and [eq]#B# components; any alpha
component is unchanged.
The conversion between linear and nonlinear encoding is performed as
described in the "`KHR_DF_TRANSFER_SRGB`" section of the Khronos Data Format
Specification.
<<<
[[appendix-compressedtex-bc]]
== Block-Compressed Image Formats
.Mapping of Vulkan BC formats to descriptions
[width="90%",options="header",cols="5,4"]
|====
| elink:VkFormat | <<data-format,Khronos Data Format Specification>> description
2+^| Formats described in the "`S3TC Compressed Texture Image Formats`" chapter
| ename:VK_FORMAT_BC1_RGB_UNORM_BLOCK |BC1 with no alpha
| ename:VK_FORMAT_BC1_RGB_SRGB_BLOCK |BC1 with no alpha, sRGB-encoded
| ename:VK_FORMAT_BC1_RGBA_UNORM_BLOCK|BC1 with alpha
| ename:VK_FORMAT_BC1_RGBA_SRGB_BLOCK |BC1 with alpha, sRGB-encoded
| ename:VK_FORMAT_BC2_UNORM_BLOCK |BC2
| ename:VK_FORMAT_BC2_SRGB_BLOCK |BC2, sRGB-encoded
| ename:VK_FORMAT_BC3_UNORM_BLOCK |BC3
| ename:VK_FORMAT_BC3_SRGB_BLOCK |BC3, sRGB-encoded
2+^| Formats described in the "`RGTC Compressed Texture Image Formats`" chapter
| ename:VK_FORMAT_BC4_UNORM_BLOCK |BC4 unsigned
| ename:VK_FORMAT_BC4_SNORM_BLOCK |BC4 signed
| ename:VK_FORMAT_BC5_UNORM_BLOCK |BC5 unsigned
| ename:VK_FORMAT_BC5_SNORM_BLOCK |BC5 signed
2+^| Formats described in the "`BPTC Compressed Texture Image Formats`" chapter
| ename:VK_FORMAT_BC6H_UFLOAT_BLOCK |BC6H (unsigned version)
| ename:VK_FORMAT_BC6H_SFLOAT_BLOCK |BC6H (signed version)
| ename:VK_FORMAT_BC7_UNORM_BLOCK |BC7
| ename:VK_FORMAT_BC7_SRGB_BLOCK |BC7, sRGB-encoded
|====
<<<
[[appendix-compressedtex-etc2]]
== ETC Compressed Image Formats
The following formats are described in the "`ETC2 Compressed Texture Image
Formats`" chapter of the <<data-format,Khronos Data Format Specification>>.
.Mapping of Vulkan ETC formats to descriptions
[options="header",cols="1,1"]
|====
| elink:VkFormat | <<data-format,Khronos Data Format Specification>> description
| ename:VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK |RGB ETC2
| ename:VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK |RGB ETC2 with sRGB encoding
| ename:VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK |RGB ETC2 with punch-through alpha
| ename:VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK |RGB ETC2 with punch-through alpha and sRGB
| ename:VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK |RGBA ETC2
| ename:VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK |RGBA ETC2 with sRGB encoding
| ename:VK_FORMAT_EAC_R11_UNORM_BLOCK |Unsigned R11 EAC
| ename:VK_FORMAT_EAC_R11_SNORM_BLOCK |Signed R11 EAC
| ename:VK_FORMAT_EAC_R11G11_UNORM_BLOCK |Unsigned RG11 EAC
| ename:VK_FORMAT_EAC_R11G11_SNORM_BLOCK |Signed RG11 EAC
|====
<<<
[[appendix-compressedtex-astc]]
== ASTC Compressed Image Formats
ASTC formats are described in the "`ASTC Compressed Texture Image Formats`"
chapter of the <<data-format,Khronos Data Format Specification>>.
.Mapping of Vulkan ASTC formats to descriptions
[width="90%",options="header",cols="50%,15%,20%,15%"]
|====
| elink:VkFormat ^| Compressed texel block dimensions ^| sRGB-encoded ^| Profile
| ename:VK_FORMAT_ASTC_4x4_UNORM_BLOCK ^|[eq]#4 {times} 4# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_4x4_SRGB_BLOCK ^|[eq]#4 {times} 4# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_5x4_UNORM_BLOCK ^|[eq]#5 {times} 4# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_5x4_SRGB_BLOCK ^|[eq]#5 {times} 4# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_5x5_UNORM_BLOCK ^|[eq]#5 {times} 5# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_5x5_SRGB_BLOCK ^|[eq]#5 {times} 5# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_6x5_UNORM_BLOCK ^|[eq]#6 {times} 5# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_6x5_SRGB_BLOCK ^|[eq]#6 {times} 5# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_6x6_UNORM_BLOCK ^|[eq]#6 {times} 6# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_6x6_SRGB_BLOCK ^|[eq]#6 {times} 6# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_8x5_UNORM_BLOCK ^|[eq]#8 {times} 5# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_8x5_SRGB_BLOCK ^|[eq]#8 {times} 5# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_8x6_UNORM_BLOCK ^|[eq]#8 {times} 6# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_8x6_SRGB_BLOCK ^|[eq]#8 {times} 6# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_8x8_UNORM_BLOCK ^|[eq]#8 {times} 8# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_8x8_SRGB_BLOCK ^|[eq]#8 {times} 8# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_10x5_UNORM_BLOCK ^|[eq]#10 {times} 5# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_10x5_SRGB_BLOCK ^|[eq]#10 {times} 5# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_10x6_UNORM_BLOCK ^|[eq]#10 {times} 6# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_10x6_SRGB_BLOCK ^|[eq]#10 {times} 6# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_10x8_UNORM_BLOCK ^|[eq]#10 {times} 8# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_10x8_SRGB_BLOCK ^|[eq]#10 {times} 8# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_10x10_UNORM_BLOCK ^|[eq]#10 {times} 10# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_10x10_SRGB_BLOCK ^|[eq]#10 {times} 10# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_12x10_UNORM_BLOCK ^|[eq]#12 {times} 10# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_12x10_SRGB_BLOCK ^|[eq]#12 {times} 10# ^|Yes ^| LDR
| ename:VK_FORMAT_ASTC_12x12_UNORM_BLOCK ^|[eq]#12 {times} 12# ^|No ^| LDR
| ename:VK_FORMAT_ASTC_12x12_SRGB_BLOCK ^|[eq]#12 {times} 12# ^|Yes ^| LDR
ifdef::VK_EXT_texture_compression_astc_hdr[]
| ename:VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT ^|[eq]#4 {times} 4# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT ^|[eq]#5 {times} 4# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT ^|[eq]#5 {times} 5# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT ^|[eq]#6 {times} 5# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT ^|[eq]#6 {times} 6# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT ^|[eq]#8 {times} 5# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT ^|[eq]#8 {times} 6# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT ^|[eq]#8 {times} 8# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 5# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 6# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 8# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT ^|[eq]#10 {times} 10# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT ^|[eq]#12 {times} 10# ^|No ^| HDR
| ename:VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT ^|[eq]#12 {times} 12# ^|No ^| HDR
endif::VK_EXT_texture_compression_astc_hdr[]
|====
ifdef::VK_EXT_astc_decode_mode[]
=== ASTC decode mode
If the `VK_EXT_astc_decode_mode` extension is enabled, the decode mode is
determined as follows:
.Mapping of Vulkan ASTC decoding format to ASTC decoding modes
[width="75%",options="header",cols="75%,25%"]
|====
| elink:VkFormat ^| Decoding mode
| ename:VK_FORMAT_R16G16B16A16_SFLOAT ^| decode_float16
| ename:VK_FORMAT_R8G8B8A8_UNORM ^| decode_unorm8
| ename:VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ^| decode_rgb9e5
|====
Otherwise, the ASTC decode mode is decode_float16.
endif::VK_EXT_astc_decode_mode[]
ifndef::VK_EXT_astc_decode_mode[]
The ASTC decode mode is decode_float16.
endif::VK_EXT_astc_decode_mode[]
ifdef::VK_IMG_format_pvrtc[]
<<<
[[appendix-compressedtex-pvrtc]]
== PVRTC Compressed Image Formats
.Mapping of Vulkan PVRTC formats to descriptions
[width="75%",options="header",cols="63%,15%,22%"]
|====
| elink:VkFormat ^| Compressed texel block dimensions ^| sRGB-encoded
| ename:VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG ^|[eq]#8 {times} 4# ^|No
| ename:VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG ^|[eq]#4 {times} 4# ^|No
| ename:VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG ^|[eq]#8 {times} 4# ^|No
| ename:VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG ^|[eq]#4 {times} 4# ^|No
| ename:VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG ^|[eq]#8 {times} 4# ^|Yes
| ename:VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG ^|[eq]#4 {times} 4# ^|Yes
| ename:VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG ^|[eq]#8 {times} 4# ^|Yes
| ename:VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG ^|[eq]#4 {times} 4# ^|Yes
|====
endif::VK_IMG_format_pvrtc[]