@@ -146,6 +146,12 @@ This is a critical mod used to generate the initial set of raw C# bindings for C
146146to using ` ClangSharpPInvokeGenerator ` . The C# source code generated by this mod is typically the starting point for all
147147of the transformations done by the rest of the SilkTouch mods.
148148
149+ Note that this mod is platform specific and will have different outputs depending on the platform. This is because
150+ ` ClangScraper ` makes use of system headers. Any platform specific differences in the API for which bindings are being
151+ generated will also affect the output.
152+
153+ (TODO: Document platform specific differences and how they are handled by Silk)
154+
149155Usage recommendations:
150156
151157This mod is configured differently from the rest of the mods. The JSON mod configuration follows the same pattern as the
@@ -545,8 +551,28 @@ attributes can also be helpful for this or other purposes.
545551
546552Mod categories: Transformation
547553
554+ This mod focuses on the transformation of enum types.
555+
548556Usage recommendations:
549557
558+ This mod can be used to reduce the platform specific differences in the generated bindings. For example, enums use
559+ signed backing types by default on Windows while enums default to unsigned backing types on Unix. This is controlled by
560+ the ` CoerceBackingTypes ` configuration option.
561+
562+ This mod can also be used to transform ` [Flags] ` enums in various ways. A ` None = 0 ` member can be added for ` [Flags] `
563+ enums that do not have an equivalent. Member values can also be rewritten to use hexadecimal for ` [Flags] ` enums and
564+ decimal values for normal enums.
565+
566+ Finally, the last feature is that member can be according to a filter. This filter can filter the type name and the
567+ member name by regex. The filter can also filter by member value. One common use case is for removing the "max value"
568+ enum members used by native libraries to ensure that enum backing types are a specific width. For example, in Vulkan,
569+ the value used is ` 0x7FFFFFFF ` , equivalent to the maximum value of a 32-bit signed integer.
570+
571+ Note: Currently, ` TransformEnums ` requires the ` [Flags] ` attribute on enum types to be added by another mod.
572+ ` TransformEnums ` does not yet have the functionality to identify enums on its own. This is a relatively high priority
573+ task. However, also note that identification will be done using a heuristic and may not be perfectly accurate. If other
574+ metadata is available for identifying ` [Flags] ` enums, consider using that instead for better results.
575+
550576### TransformFunctions
551577
552578Mod categories: Transformation
0 commit comments