Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
30b2302
Add UASTC HDR.
MarkCallow Aug 24, 2024
2161c07
Address review comments.
MarkCallow Aug 24, 2024
f97f381
Remove excess spaces.
MarkCallow Aug 24, 2024
2bac56a
Clarify that GPUs must support ASTC HDR to use UASTC HDR directly.
MarkCallow Aug 25, 2024
654f14b
Fix channel id -> type and require SAMPLE_DATATYPE_FLOAT.
MarkCallow Aug 25, 2024
406c01d
Revert channel id->type changes.
MarkCallow Aug 26, 2024
a2fc605
Update language on use of VK_FORMAT_UNDEFINED.
MarkCallow Aug 27, 2024
f212aae
Add note re. Vulkan ASTC HDR names.
MarkCallow Aug 28, 2024
5231e99
Make supercompression statements for UASTC {,HDR} more generic.
MarkCallow Sep 26, 2024
44c2042
Improve RDO language.
MarkCallow Sep 26, 2024
6741262
Fix RDO description.
MarkCallow Sep 27, 2024
58d7b2e
Update for UASTC HDR 6x6.
MarkCallow Oct 3, 2024
a166210
Tweak formatting.
MarkCallow Oct 3, 2024
cc7ddcf
Fine tune UASTC HDR language for two block sizes.
MarkCallow Oct 4, 2024
a090e45
Add KTXmapRange metadata.
MarkCallow Oct 15, 2024
f8f84ce
Fine tune KTXmapRange.
MarkCallow Oct 15, 2024
1adfe59
Address review comments on KTXmapRange.
MarkCallow Oct 16, 2024
f3f2af0
First cut at adding GPU Photo 6x6.
MarkCallow Jan 23, 2025
d761af5
Use just GPU Photo to allow for future formats.
MarkCallow Jan 23, 2025
a52e0cf
Align rebase bytesPlane changes coming with rebase.
MarkCallow Feb 1, 2025
658bfb8
Address further review comments.
MarkCallow Feb 1, 2025
1d0e373
Fix typo and say KTXmapRange values must be finite.
MarkCallow Feb 3, 2025
ad6e953
Make KTXmapRange language more normative.
MarkCallow Feb 7, 2025
604c71d
Fix bad link and formatting in KTXmapRange equation.
MarkCallow Feb 19, 2025
b80607d
Make this doc revision 5 (draft).
MarkCallow Feb 19, 2025
1613e52
Move GPU Photo supercompression to vendor list.
MarkCallow Feb 25, 2025
1a3bee5
Fix copy-paste error.
MarkCallow Feb 25, 2025
1e06f4e
Update based on latest information from Binomial.
MarkCallow Sep 6, 2025
f3403aa
Rename Basis Universal ASTC to Basis Universal UASTC
MarkCallow Sep 18, 2025
4be25d0
Fix link to UASTC HDR 6x6 spec.
MarkCallow Sep 18, 2025
8d90106
Add ToC.
MarkCallow Sep 18, 2025
5a72d8a
Update rev history to note addition of ToC.
MarkCallow Sep 18, 2025
d1a8aeb
Fix texelDimension values and add requirement for sampleLower 0.
MarkCallow Sep 19, 2025
71aa7ff
State that UASTC 6x6 6-byte header is not included.
MarkCallow Oct 9, 2025
0052491
Improve spec for calculating size of UASTC 6x6 images.
MarkCallow Oct 10, 2025
c753a79
Address all but one of @lexaknyazev's comments.
MarkCallow Oct 10, 2025
3be0d4d
Minor tweaks.
MarkCallow Oct 11, 2025
2088f9d
Address @lexaknyazev mapRange comments.
MarkCallow Oct 11, 2025
a4c5958
Make content block wider. Restore ribbon logo.
MarkCallow Oct 11, 2025
c6d3ad2
Remove deprecated max-width attribute.
MarkCallow Oct 11, 2025
5907e4b
Make files with incompatible formats and KTXmapRange invalid.
MarkCallow Oct 17, 2025
d1624fc
Restore UAH6i header; add rgbSliceType.
MarkCallow Feb 9, 2026
13b22a1
Address review comments.
MarkCallow Feb 10, 2026
179ee0a
Match compression type language used in latest Binomial bitstream spe…
MarkCallow Feb 14, 2026
eb3f37b
Don't use undefined "word".
MarkCallow Feb 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ktx_inlined_images := icons/ktx_favicon.ico \
appendices=appendices

ktx_sources := ktxspec.adoc \
$(appendices)/basisuah66i-gdata.adoc \
$(appendices)/basisuah66i-bitstream.adoc \
$(appendices)/basislz-gdata.adoc \
$(appendices)/basislz-bitstream.adoc \
$(appendices)/vendor-metadata.adoc \
Expand Down
3 changes: 2 additions & 1 deletion appendices/basislz-gdata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

BasisLZ combines encoding to a block-compressed format, that can be easily transcoded to various GPU-native block-compressed formats, with lossless supercompression. Supercompression is accomplished by conditioning the block-compressed representation for entropy encoding then Huffman encoding the result. BasisLZ creates a global codebook referenced by each supercompressed image that contains the processed endpoint and selector data from the block-compression and the Huffman tables. The global data block contains this codebook.

It also contains an array of _image descriptors_ with flags for each image and the offset and length within the mip level of the data for that image.
It also contains an array of _image descriptors_ with flags for each image and the offset within its mip level and length of the data for that image.

The global data structure is designed to accommodate various transcodable block-compressed formats. The format in use is indicated by the <<_data_format_descriptor, Data Format Descriptor>>. Currently BasisLZ only supports one, <<etc1s, ETC1S>> (a subset of ETC1, see {url-df-spec}#ETC1S[Section 21.1] of <<KDF14>>). ETC1S is a common subset of many GPU-native formats.

Expand Down Expand Up @@ -139,3 +139,4 @@ in <<ETC1S Slice Huffman Tables>>.
=== extendedData
Extended data. This is not used for ETC1S.

// vim: filetype=asciidoc ai expandtab tw=0 ts=4 sts=2 sw=2
15 changes: 15 additions & 0 deletions appendices/basisuah66i-bitstream.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[appendix#basisuah66i]
[#basisuah66i_bitstream]
== Basis UASTC HDR 6x6 Intermediate Bitstream Specification

_Basis UASTC HDR 6x6 Intermediate_ is a custom supercompression scheme for the Basis UASTC HDR 6x6 texture format.

The bitstream is as documented in the https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-6x6-Intermediate-File-Format-(Basis-GPU-Photo-6x6)[format specification] on the basis_universal Wiki.
The compression type is signalled by `supercompressionScheme` = 4 and `colorModel` = 168.
The bitstream has a https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-6x6-Intermediate-File-Format-(Basis-GPU-Photo-6x6)#header[header] of 3 little-endian 16-bit fields.
The first field is a combined ID field containing the entropy profile and stream semantic version with the profile ID in bits 15-8 (the second byte) and the stream semantic version in bits 7-0 (the first byte).
This field must match the least significant 16-bits of (the first two bytes) of `rgbSliceType` in the <<basisuah66i_image_desc,ImageDesc>> that refers to the bitstream.
The second and third fields are the width and height of the texture image in pixels.
The value of the width field must equal stem:[\textit{num_blocks_x}] and the value of the height field must equal stem:[\textit{num_blocks_y}] as calculated for the mip level using <<levelImages_defs,these formulae>>. Since the width and height are in pixels, stem:[\textit{block_width}] and stem:[\textit{block_height}] in those formulae must be stem:[1].

// vim: filetype=asciidoc ai expandtab tw=0 ts=4 sts=2 sw=2
77 changes: 77 additions & 0 deletions appendices/basisuah66i-gdata.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[appendix#basisuah66i_gd]
== Basis UASTC HDR 6x6 Intermediate Global Data

Basis UASTC HDR 6x6 Intermediate format combines encoding to the UASTC HDR 6x6 subset of ASTC, that can be easily transcoded to BC6H unsigned, with lossless supercompression.
The format uses a small number of variable bit length command codes which can output one or more blocks, and which can reuse parts of previously encoded blocks.
Because of the variable size of each image Basis UASTC HDR 6x6 Intermediate creates a global data structure that contains an array of _image descriptors_ with the offset within its mip level and the length of the data for that image.


[[basisuah66i_global_data_structure]]
.Basis UASTC HDR 6x6 Global Data Structure
[source,c,subs="+quotes,+attributes,+replacements"]
----
ImageDesc[imageCount] imageDescs;
----

`ImageDesc` is the following structure.

.ImageDesc
[source,c]
----
UInt32 rgbSliceByteOffset
UInt32 rgbSliceByteLength
UInt32 rgbSliceType
----
Comment thread
MarkCallow marked this conversation as resolved.

Descriptions in the `imageDescs` array are in the order layer, face and z_slice as if arranged by the following pseudo code.
[source,c]
----
for each level in max(levelCount, 1)
for each layer in max (layerCount, 1)
for each face in faceCount // 1 or 6
for each z_slice in max((pixelDepth of level), 1)
----

`imageCount` is the total number of images in the Mip Level Array.

[TIP]
====
`imageCount` may be calculated as follows:
[source,c]
----
int imageCount = max(layerCount, 1) * faceCount * layerPixelDepth;

// where layerPixelDepth can be derived as
int layerPixelDepth = max(pixelDepth, 1);
for(int i = 1; i < levelCount; i++)
layerPixelDepth += max(pixelDepth >> i, 1);
----
====

There must be no trailing bytes in the global data section after the array of image descriptors, i.e., the following condition must always be true:
[source,c]
----
sgdByteLength == imageCount * 12
----

[[basisuah66i_image_desc]]
=== ImageDesc
==== rgbSliceByteOffset, rgbSliceByteLength
The offset of the start of the RGB slice within the <<levelImagesDesc,levelImages>> of its mip level and its byte length. The offset of <<levelImagesDesc,levelImages>> within the file is given in the <<_level_index,Level Index>>.

`rgbSliceByteLength` must not be zero.

`rgbSliceByteOffset + rgbSliceByteLength` must not be greater than the byte length of the corresponding mip level.

[[basisuah66i_rgbSliceType]]
==== rgbSliceType
The combined ID field containing the entropy profile and stream semantic version used in the bitstream for this slice.
The least significant 16-bits (the first two bytes) of this value must equal the first 16-bits of the bitstream for this slice as described in the https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-6x6-Intermediate-File-Format-(Basis-GPU-Photo-6x6)#header[header section] of the bitstream specification.
The most significant 16-bits (the last two bytes) must be 0.
[NOTE]
.Rationale
====
Implementations can use this field to check for an unsupported version without having to load the data.
====

// vim: filetype=asciidoc ai expandtab tw=0 ts=4 sts=2 sw=2
12 changes: 8 additions & 4 deletions docinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
/* Put Khronos ribbon on left side */
background-attachment: fixed;
background-image: url(images/logo-spec.svg);
background-position: left top;
background-position: right top;
background-repeat: no-repeat/*, no-repeat*/;
/* Override default Asciidoctor margin settings to center the page. */
margin: 2em auto 2em auto;
max-width: 60em;
/* If wider than in #content below, this adds extra margin. */
max-width: 100em;
}

#content {
/* Override max from khronos.css. */
max-width: 62.5em
}

div.legal p {
Expand Down
Loading
Loading