ash/generator/src
Marijn Suijten 5732d977cf
generator: Borrow all command names and disentangle "aliases" (#733)
Turns out we were doing the wrong thing for the right reason: the
`aliases` here aren't `vk.xml` aliases: they are renames.  When
generating function pointers for extensions, a list of command
_definitions_ is collected, which can only ever be "root" `command`s.
Extensions typically reference stabilized `command`s under an alias with
the vendor tag suffixed, which the `Fn` struct field name is renamed to
using this `aliases` - now replaced with `rename_commands` - list, while
generating the rest of the "function pointer" command bits using the
"root" `command` (as this mostly pertains the parameters and return
type).  With that explanation it becomes clear why
`generate_extension_commands()` was creating an "alias" mapping from
stabilized name to vendor-suffixed extension name, and calls
`generate_function_pointers()` with that mapping - and a list of
stabilized/root `command`s - rather than passing `cmd_aliases` directly.
(This `cmd_aliases` list exists because the rename always happens in the
root `<commands>` element: extensions then `<require>` the aliased
rather than the stabilized name, so the base for this alias is found
first to look up the base command, and then stored in `rename_commands`
to rename it back to the aliased name).

With improved clarity we can now also borrow the name strings rather
than cloning them in many places.
2023-04-05 23:42:21 +02:00
..
bin Vulkan 1.2.175: Provisional Video Extensions (#417) 2021-06-06 11:00:29 +02:00
lib.rs generator: Borrow all command names and disentangle "aliases" (#733) 2023-04-05 23:42:21 +02:00