Puts the contents of a switch in a big array, then rewrites
vkuGetFormatInfo() to index into it based on the formats enum value.
This was done because the switch statement was large enough that
compilers wouldn't inline the function, leading to performance bubbles.
The logic for generating the logic of vkuGetFormatInfo is complex but
boils down to finding the groups of consecutive VkFormats, where the
end of a group has a value that is more than 1 away from the next format
value.
To follow C const initializer rules, VKU_FORMAT_COMPRESSED_COMPONENT
had to be turned into a macro.
The library originates from Vulkan-ValidationLayers, but is being moved
into this repo to make it easier for others to use it.
The library has also been modified to be header only and C compatible,
which allows more developers to be able to use it. This does require some
changes, but only affects the vkuFormatElementSize and vkuFormatTexelSize
functions which used default parameters. Two new functions,
vkuFormatElementSizeWithAspect and vkuFormatTexelSizeWithAspect have been
added to handle the non-default image aspect case (the default was COLOR_BIT).
Renaming was done using the following convention:
* public header files begin with `vk_`
* enums begin with VKU_FORMAT_
* functions begin with vku