vulkan: enum generator: generate extension number defines
New extensions can introduce additional enums. Most of the new enums
will have disjoint numbers from the initial enums. For example new
formats introduced by VK_IMG_format_pvrtc :
VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG =
1000054000,
VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG =
1000054001,
VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG =
1000054002,
VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG =
1000054003,
VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG =
1000054004,
VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG =
1000054005,
VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG =
1000054006,
VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG =
1000054007,
It's obvious we can't have a single table for handling those anymore.
Fortunately the enum values actually contain the number of the
extension that introduced the new enums. So we can build an
indirection table off the extension number and then index by
subtracting the first enum of the the format enum value.
This change makes the extension number available in the generated enum
code.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>