Replies: 1 comment 1 reply
-
The DFD is required so that applications will be able operate on the payload, outside of format changes, without having to understand the VkFormat enums. The DFD provides a description of the format that is usable by programs. If only certain KTX files had a valid DFD there is less likelihood of such programs emerging. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am curious why the DFD is always required in KTX2 files. It seems like allowing a dfdTotalSize value of 0 should be okay when the Vulkan format is not VK_FORMAT_UNDEFINED since the two must be equivalent representations of each other. In systems that want to use the KTX2 format and use the Vulkan format as the primary image encoding scheme, having to write and read a DFD is extra work/maintenance for something that will just be ignored anyway. Which creates a situation where we either continue to use the inhouse image format, or write a VK_FORMAT to DFD converter and then read and write (at least) 40 extra bytes per file that are there for the sole purpose of satisfying the spec. But it is hard to justify the extra work which defeats the goal of moving to more generic formats which has several nice advantages like the checkKTX program, and generic tools that can read/write the format.
A very simple change to the spec allowing a zero sized DFD (meaing the DFD and vulkan format are the only formats for the data and they are equivelent) seems like a simple generic change that helps keep the complexity and size of the KTX format low while allowing tools based on the format to be written to spec.
In conjunction its seems like a function/table that takes a Vulkan Format and outputs its equivalent DFD format would make adoption of the format easier for folks struggling with issues like this. This seems appropriate for the Vulkan formats specifically since KTX2 has the vulkan descriptor written directly in its header. (and perhaps a function to take a DFD format and output a vulkan format).
So I no more then wrote this and found the two functions mentioned above already implemented. (wow you all are fast!) Which I would think would make it even easier to make the DFD optional.
Also, the Vulkan Format is allowed to be undefined so it seems like there is a nice symmetry here to allow the dfd to essentially be undefined when the vulkan format is defined.
Beta Was this translation helpful? Give feedback.
All reactions