[Mesa-dev] [PATCH 0/5] Vulkan: add extensions numbers to generated enums

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Jun 28 16:18:35 UTC 2017


Hi,

We already have seen extensions like VK_IMG_format_pvrtc introduce new
formats. The way the Vulkan specification seems to deal with new
formats is to place them at an offset based on the associated
extension number.

The anv driver currently stores the formats in an array indexed by the
format id. This is kind of convenient and avoids really long switch
statements. Unfortunately new formats with id numbers well beyong
10000000 mean we cannot keep on doing this.

This series introduce new generated defines for extension numbers so
we can deal with those new id using an indirection table based off the
extension number. The first 3 patches are just rework, the generated
defines are in patch 4 and associated helpers in patch 5.

Cheers,

Lionel Landwerlin (5):
  vulkan: enum generator: align function declarations/prototypes
  vulkan: enum generator: sort enums by names
  vulkan: enum generator: make registry more flexible
  vulkan: enum generator: generate extension number defines
  vulkan: util: add macros to extract extension/offset number from enums

 src/vulkan/util/gen_enum_to_str.py | 68 ++++++++++++++++++++++++--------------
 src/vulkan/util/vk_util.h          |  7 ++++
 2 files changed, 51 insertions(+), 24 deletions(-)

--
2.13.2


More information about the mesa-dev mailing list