@@ -341,8 +341,30 @@ intercepting these native functions is so that function pointers can be automati
341341
342342Mod categories: Metadata, Naming
343343
344+ This mod naively adds ` [NativeName] ` attributes to most identifiers in the generated bindings and is designed to be
345+ placed immediately after ` ClangScraper ` . Syntax nodes that are not output by ` ClangScraper ` are intentionally not
346+ processed.
347+
348+ The name stored by the ` [NativeName] ` attribute matches the C# identifier at the time the mod runs. This assumes that
349+ the name used by the C# source code matches the name used by the native source code, which is * usually* the case when
350+ this mod is placed immediately after ` ClangScraper ` . However, there are cases where the names output by ` ClangScraper `
351+ do not correspond to native names. These cases are usually because there is no native name available, such as for
352+ inline array types (named in the format ` _name_e__FixedBuffer ` ) or backing fields used by bitfield structs (named
353+ ` _bitfield ` ).
354+
344355Usage recommendations:
345356
357+ As mentioned, this mod is best used immediately after ` ClangScraper ` runs. This should mark all identifiers output
358+ by ` ClangScraper ` itself.
359+
360+ However, do not assume that this mod is sufficient to mark all identifiers present in the final set of generated
361+ bindings. When other mods introduce new identifiers, those mods will need to add ` [NativeName] ` attributes themselves,
362+ or have another mod do it for them, in the case those identifiers represent a native API.
363+
364+ Because the name stored as the value for ` [NativeName] ` comes from the native API, it can be used as a stable identifier
365+ for an API. This is in contrast to the current C# identifier being used, as that identifier is often transformed by mods
366+ such as ` [PrettifyNames] ` .
367+
346368### MixKhronosData
347369
348370Mod categories: Creation, Metadata, Naming, Transformation
0 commit comments