-
Notifications
You must be signed in to change notification settings - Fork 13
Add UASTC HDR. #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MarkCallow
wants to merge
45
commits into
main
Choose a base branch
from
uastc_hdr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add UASTC HDR. #216
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
30b2302
Add UASTC HDR.
MarkCallow 2161c07
Address review comments.
MarkCallow f97f381
Remove excess spaces.
MarkCallow 2bac56a
Clarify that GPUs must support ASTC HDR to use UASTC HDR directly.
MarkCallow 654f14b
Fix channel id -> type and require SAMPLE_DATATYPE_FLOAT.
MarkCallow 406c01d
Revert channel id->type changes.
MarkCallow a2fc605
Update language on use of VK_FORMAT_UNDEFINED.
MarkCallow f212aae
Add note re. Vulkan ASTC HDR names.
MarkCallow 5231e99
Make supercompression statements for UASTC {,HDR} more generic.
MarkCallow 44c2042
Improve RDO language.
MarkCallow 6741262
Fix RDO description.
MarkCallow 58d7b2e
Update for UASTC HDR 6x6.
MarkCallow a166210
Tweak formatting.
MarkCallow cc7ddcf
Fine tune UASTC HDR language for two block sizes.
MarkCallow a090e45
Add KTXmapRange metadata.
MarkCallow f8f84ce
Fine tune KTXmapRange.
MarkCallow 1adfe59
Address review comments on KTXmapRange.
MarkCallow f3f2af0
First cut at adding GPU Photo 6x6.
MarkCallow d761af5
Use just GPU Photo to allow for future formats.
MarkCallow a52e0cf
Align rebase bytesPlane changes coming with rebase.
MarkCallow 658bfb8
Address further review comments.
MarkCallow 1d0e373
Fix typo and say KTXmapRange values must be finite.
MarkCallow ad6e953
Make KTXmapRange language more normative.
MarkCallow 604c71d
Fix bad link and formatting in KTXmapRange equation.
MarkCallow b80607d
Make this doc revision 5 (draft).
MarkCallow 1613e52
Move GPU Photo supercompression to vendor list.
MarkCallow 1a3bee5
Fix copy-paste error.
MarkCallow 1e06f4e
Update based on latest information from Binomial.
MarkCallow f3403aa
Rename Basis Universal ASTC to Basis Universal UASTC
MarkCallow 4be25d0
Fix link to UASTC HDR 6x6 spec.
MarkCallow 8d90106
Add ToC.
MarkCallow 5a72d8a
Update rev history to note addition of ToC.
MarkCallow d1a8aeb
Fix texelDimension values and add requirement for sampleLower 0.
MarkCallow 71aa7ff
State that UASTC 6x6 6-byte header is not included.
MarkCallow 0052491
Improve spec for calculating size of UASTC 6x6 images.
MarkCallow c753a79
Address all but one of @lexaknyazev's comments.
MarkCallow 3be0d4d
Minor tweaks.
MarkCallow 2088f9d
Address @lexaknyazev mapRange comments.
MarkCallow a4c5958
Make content block wider. Restore ribbon logo.
MarkCallow c6d3ad2
Remove deprecated max-width attribute.
MarkCallow 5907e4b
Make files with incompatible formats and KTXmapRange invalid.
MarkCallow d1624fc
Restore UAH6i header; add rgbSliceType.
MarkCallow 13b22a1
Address review comments.
MarkCallow 179ee0a
Match compression type language used in latest Binomial bitstream spe…
MarkCallow eb3f37b
Don't use undefined "word".
MarkCallow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ---- | ||
|
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.