Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .silktouch/openal-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/vulkan-clangsharp.stout
Binary file not shown.
64 changes: 42 additions & 22 deletions generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
"AddIncludes",
"ClangScraper",
"MarkNativeNames",
"ExtractHandles",
"ExtractNestedTyping",
"TransformHandles",
"TransformFunctions",
"TransformProperties",
"IdentifySharedPrefixes",
"PrettifyNames",
"TransformEnums",
"AddVTables",
Expand All @@ -59,17 +61,23 @@
"InputTestRoot": "tests/SDL"
},
"TransformHandles": {
"AssumeMissingTypesOpaque": true,
"UseDSL": true
"UseDsl": true
},
"TransformFunctions": {
"BoolTypes": {
"SDL_bool": null
}
},
"PrettifyNames": {
"IdentifySharedPrefixes": {
"GlobalPrefixHints": ["SDL"]
},
"PrettifyNames": {
"Affixes": {
"SharedPrefix": {
"Remove": true
}
}
},
"TransformEnums": {
"AddNoneMemberToFlags": true,
"RewriteMemberValues": true
Expand All @@ -95,6 +103,7 @@
"MixKhronosData",
"AddOpaqueStructs",
"TransformFunctions",
"IdentifySharedPrefixes",
"PrettifyNames",
"TransformEnums",
"AddVTables",
Expand Down Expand Up @@ -171,14 +180,17 @@
}
]
},
"PrettifyNames": {
"IdentifySharedPrefixes": {
"GlobalPrefixHints": ["gl"],
"PrefixOverrides": {
"SyncObjectMask": "GL_SYNC",
"OcclusionQueryParameterNameNV": "GL",
"TexStorageAttribs": "GL",
"ContainerType": "GL"
},
"ContainerType": "GL",
"SeparableTargetEXT": "GL"
}
},
"PrettifyNames": {
"Affixes": {
"HandleType": {
"Order": 1
Expand All @@ -197,6 +209,9 @@
},
"KhronosNonExclusiveVendor": {
"Remove": true
},
"SharedPrefix": {
"Remove": true
}
}
},
Expand Down Expand Up @@ -228,10 +243,12 @@
"ChangeNativeClass",
"AddApiProfiles",
"MixKhronosData",
"ExtractHandles",
"ExtractNestedTyping",
"TransformHandles",
"InterceptNativeFunctions",
"TransformFunctions",
"IdentifySharedPrefixes",
"PrettifyNames",
"TransformEnums",
"AddVTables",
Expand Down Expand Up @@ -294,25 +311,20 @@
}
]
},
"IdentifySharedPrefixes": {
"GlobalPrefixHints": ["alc", "al"]
},
"PrettifyNames": {
"GlobalPrefixHints": ["alc", "al"],
"NameOverrides": {
"ALContext": "ALContext",
"EFXEAXREVERBPROPERTIES": "EfxEaxReverbProperties",
"EFXEAXREVERBPROPERTIES_flReflectionsPan": "EfxEaxReverbPropertiesFlReflectionsPan",
"EFXEAXREVERBPROPERTIES_flLateReverbPan": "EfxEaxReverbPropertiesFlLateReverbPan",
"ALCcontextHandle": "ContextHandle",
"ALCdeviceHandle": "DeviceHandle",
"ALBUFFERCALLBACKTYPESOFT": "BufferCallbackSOFT",
"ALBUFFERCALLBACKTYPESOFTDelegate": "BufferCallbackDelegateSOFT",
"ALCEVENTPROCTYPESOFT": "ContextEventProcSOFT",
"ALCEVENTPROCTYPESOFTDelegate": "ContextEventProcDelegateSOFT",
"ALEVENTPROCSOFT": "EventProcSOFT",
"ALEVENTPROCSOFTDelegate": "EventProcDelegateSOFT",
"ALDEBUGPROCEXT": "DebugProcEXT",
"ALDEBUGPROCEXTDelegate": "DebugProcDelegateEXT",
"LPALFOLDBACKCALLBACK": "FoldbackCallback",
"LPALFOLDBACKCALLBACKDelegate": "FoldbackCallbackDelegate"
"LPALFOLDBACKCALLBACK": "FoldbackCallback"
},
"Affixes": {
"HandleType": {
Expand All @@ -332,6 +344,9 @@
},
"KhronosNonExclusiveVendor": {
"Remove": true
},
"SharedPrefix": {
"Remove": true
}
}
},
Expand All @@ -347,8 +362,7 @@
"BenefitOfTheDoubtArrayTransformation": true
},
"TransformHandles": {
"AssumeMissingTypesOpaque": true,
"UseDSL": true
"UseDsl": true
},
"StripAttributes": {
"Remove": [
Expand All @@ -366,13 +380,15 @@
"AddIncludes",
"ClangScraper",
"MarkNativeNames",
"ExtractHandles",
"ExtractNestedTyping",
"TransformHandles",
"MixKhronosData",
"AddApiProfiles",
"InterceptNativeFunctions",
"TransformFunctions",
"TransformProperties",
"IdentifySharedPrefixes",
"PrettifyNames",
"TransformEnums",
"AddVTables",
Expand Down Expand Up @@ -419,15 +435,16 @@
}
},
"TransformHandles": {
"AssumeMissingTypesOpaque": true,
"UseDSL": true
"UseDsl": true
},
"PrettifyNames": {
"GlobalPrefixHints": ["PFN_vk","vk"],
"IdentifySharedPrefixes": {
"GlobalPrefixHints": ["PFN_vk", "vk"],
"PrefixOverrides": {
"VkPipelineCreateFlags2": "VK_PIPELINE_CREATE_2",
"VkMemoryDecompressionMethodFlagsEXT": "VK_MEMORY_DECOMPRESSION_METHOD"
},
}
},
"PrettifyNames": {
"NameOverrides": {
"numAABBs": "NumAabbs"
},
Expand All @@ -446,6 +463,9 @@
},
"KhronosHandleType": {
"Remove": true
},
"SharedPrefix": {
"Remove": true
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion sources/OpenAL/OpenAL/al/BufferCallbackSOFT.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Silk.NET.OpenAL;

public BufferCallbackSOFT(delegate* unmanaged<void*, void*, int, int> ptr) => Pointer = ptr;

public BufferCallbackSOFT(BufferCallbackDelegateSOFT proc) =>
public BufferCallbackSOFT(BufferCallbackSOFTDelegate proc) =>
Pointer = SilkMarshal.DelegateToPtr(proc);

public void Dispose() => SilkMarshal.Free(Pointer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
namespace Silk.NET.OpenAL;

[NativeName("ALBUFFERCALLBACKTYPESOFT")]
public unsafe delegate int BufferCallbackDelegateSOFT(void* arg0, void* arg1, int arg2);
public unsafe delegate int BufferCallbackSOFTDelegate(void* arg0, void* arg1, int arg2);
2 changes: 1 addition & 1 deletion sources/OpenAL/OpenAL/al/ContextEventProcSOFT.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ContextEventProcSOFT(
delegate* unmanaged<int, int, DeviceHandle, int, sbyte*, void*, void> ptr
) => Pointer = ptr;

public ContextEventProcSOFT(ContextEventProcDelegateSOFT proc) =>
public ContextEventProcSOFT(ContextEventProcSOFTDelegate proc) =>
Pointer = SilkMarshal.DelegateToPtr(proc);

public void Dispose() => SilkMarshal.Free(Pointer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Silk.NET.OpenAL;

[NativeName("ALCEVENTPROCTYPESOFT")]
public unsafe delegate void ContextEventProcDelegateSOFT(
public unsafe delegate void ContextEventProcSOFTDelegate(
int arg0,
int arg1,
DeviceHandle arg2,
Expand Down
2 changes: 1 addition & 1 deletion sources/OpenAL/OpenAL/al/DebugProcEXT.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Silk.NET.OpenAL;
public DebugProcEXT(delegate* unmanaged<int, int, uint, int, int, sbyte*, void*, void> ptr) =>
Pointer = ptr;

public DebugProcEXT(DebugProcDelegateEXT proc) => Pointer = SilkMarshal.DelegateToPtr(proc);
public DebugProcEXT(DebugProcEXTDelegate proc) => Pointer = SilkMarshal.DelegateToPtr(proc);

public void Dispose() => SilkMarshal.Free(Pointer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Silk.NET.OpenAL;

[NativeName("ALDEBUGPROCEXT")]
public unsafe delegate void DebugProcDelegateEXT(
public unsafe delegate void DebugProcEXTDelegate(
int arg0,
int arg1,
uint arg2,
Expand Down
2 changes: 1 addition & 1 deletion sources/OpenAL/OpenAL/al/EventProcSOFT.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Silk.NET.OpenAL;
public EventProcSOFT(delegate* unmanaged<int, uint, uint, int, sbyte*, void*, void> ptr) =>
Pointer = ptr;

public EventProcSOFT(EventProcDelegateSOFT proc) => Pointer = SilkMarshal.DelegateToPtr(proc);
public EventProcSOFT(EventProcSOFTDelegate proc) => Pointer = SilkMarshal.DelegateToPtr(proc);

public void Dispose() => SilkMarshal.Free(Pointer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Silk.NET.OpenAL;

[NativeName("ALEVENTPROCSOFT")]
public unsafe delegate void EventProcDelegateSOFT(
public unsafe delegate void EventProcSOFTDelegate(
int arg0,
uint arg1,
uint arg2,
Expand Down
16 changes: 11 additions & 5 deletions sources/SilkTouch/SilkTouch/Mods/BakeSourceSets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Rewriter(IBakeStrategy strategy, ILogger<BakeSourceSets> logger) : ModCSha
public override SyntaxNode? VisitIndexerDeclaration(IndexerDeclarationSyntax node) =>
Visit(
node,
$"this[{string.Join(", ", node.ParameterList.Parameters.Select(ModUtils.DiscrimStr))}]",
$"this[{string.Join(", ", node.ParameterList.Parameters.Select(ModUtils.GetMethodDiscriminator))}]",
base.VisitIndexerDeclaration
);

Expand All @@ -122,7 +122,13 @@ ConstructorDeclarationSyntax node
) =>
Visit(
node,
ModUtils.DiscrimStr(node.Modifiers, null, string.Empty, node.ParameterList, null),
ModUtils.GetMethodDiscriminator(
node.Modifiers,
null,
string.Empty,
node.ParameterList,
null
),
base.VisitConstructorDeclaration
);

Expand All @@ -132,7 +138,7 @@ ConstructorDeclarationSyntax node
public override SyntaxNode? VisitOperatorDeclaration(OperatorDeclarationSyntax node) =>
Visit(
node,
ModUtils.DiscrimStr(
ModUtils.GetMethodDiscriminator(
node.Modifiers,
null,
$"op_{node.OperatorToken.Kind()}",
Expand All @@ -147,7 +153,7 @@ ConversionOperatorDeclarationSyntax node
) =>
Visit(
node,
ModUtils.DiscrimStr(
ModUtils.GetMethodDiscriminator(
node.Modifiers,
null,
$"op_{node.ImplicitOrExplicitKeyword.Kind()}",
Expand All @@ -160,7 +166,7 @@ ConversionOperatorDeclarationSyntax node
public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) =>
Visit(
node,
ModUtils.DiscrimStr(
ModUtils.GetMethodDiscriminator(
node.Modifiers,
node.TypeParameterList,
node.Identifier.ToString(),
Expand Down
22 changes: 12 additions & 10 deletions sources/SilkTouch/SilkTouch/Mods/Common/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ public class ModLoader
public static Type? LoadModByName(string name) =>
name switch
{
nameof(ChangeNamespace) => typeof(ChangeNamespace),
nameof(AddApiProfiles) => typeof(AddApiProfiles),
nameof(AddIncludes) => typeof(AddIncludes),
nameof(TransformFunctions) => typeof(TransformFunctions),
nameof(PrettifyNames) => typeof(PrettifyNames),
nameof(AddOpaqueStructs) => typeof(AddOpaqueStructs),
nameof(AddVTables) => typeof(AddVTables),
nameof(BakeSourceSets) => typeof(BakeSourceSets),
nameof(AddApiProfiles) => typeof(AddApiProfiles),
nameof(MixKhronosData) => typeof(MixKhronosData),
nameof(TransformHandles) => typeof(TransformHandles),
nameof(TransformEnums) => typeof(TransformEnums),
nameof(ExtractNestedTyping) => typeof(ExtractNestedTyping),
nameof(TransformProperties) => typeof(TransformProperties),
nameof(ClangScraper) => typeof(ClangScraper),
nameof(ChangeNamespace) => typeof(ChangeNamespace),
nameof(ChangeNativeClass) => typeof(ChangeNativeClass),
nameof(ClangScraper) => typeof(ClangScraper),
nameof(ExtractHandles) => typeof(ExtractHandles),
nameof(ExtractNestedTyping) => typeof(ExtractNestedTyping),
nameof(IdentifySharedPrefixes) => typeof(IdentifySharedPrefixes),
nameof(InterceptNativeFunctions) => typeof(InterceptNativeFunctions),
nameof(MarkNativeNames) => typeof(MarkNativeNames),
nameof(MixKhronosData) => typeof(MixKhronosData),
nameof(PrettifyNames) => typeof(PrettifyNames),
nameof(StripAttributes) => typeof(StripAttributes),
nameof(TransformEnums) => typeof(TransformEnums),
nameof(TransformFunctions) => typeof(TransformFunctions),
nameof(TransformHandles) => typeof(TransformHandles),
nameof(TransformProperties) => typeof(TransformProperties),
_ => null,
};
}
Loading
Loading