Skip to content
  •  
  •  
  •  
Binary file modified .silktouch/openal-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/opengl-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/sdl-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/vulkan-clangsharp.stout
Binary file not shown.
21 changes: 21 additions & 0 deletions generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
"SDL_bool": null
}
},
"TransformProperties": {
"BoolTypes": {
"SDL_bool": null
}
},
"IdentifySharedPrefixes": {
"GlobalPrefixHints": ["SDL"]
},
Expand Down Expand Up @@ -224,6 +229,11 @@
"GLboolean": null
}
},
"TransformProperties": {
"BoolTypes": {
"GLboolean": null
}
},
"StripAttributes": {
"Remove": [
"NativeTypeName",
Expand Down Expand Up @@ -361,6 +371,12 @@
},
"BenefitOfTheDoubtArrayTransformation": true
},
"TransformProperties": {
"BoolTypes": {
"ALboolean": null,
"ALCboolean": null
}
},
"TransformHandles": {
"UseDsl": true
},
Expand Down Expand Up @@ -434,6 +450,11 @@
"VkBool32": null
}
},
"TransformProperties": {
"BoolTypes": {
"VkBool32": null
}
},
"TransformHandles": {
"UseDsl": true
},
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/AssertData.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Silk.NET.SDL;
public unsafe partial struct AssertData
{
[NativeName("always_ignore")]
public byte AlwaysIgnore;
public MaybeBool<byte> AlwaysIgnore;

[NativeName("trigger_count")]
public uint TriggerCount;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/AudioDeviceEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial struct AudioDeviceEvent
public uint Which;

[NativeName("recording")]
public byte Recording;
public MaybeBool<byte> Recording;

[NativeName("padding1")]
public byte Padding1;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/ClipboardEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public unsafe partial struct ClipboardEvent
public ulong Timestamp;

[NativeName("owner")]
public byte Owner;
public MaybeBool<byte> Owner;

[NativeName("num_mime_types")]
public int NumMimeTypes;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/GamepadButtonEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial struct GamepadButtonEvent
public byte Button;

[NativeName("down")]
public byte Down;
public MaybeBool<byte> Down;

[NativeName("padding1")]
public byte Padding1;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/GpuBlitInfo.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public partial struct GpuBlitInfo
public GpuFilter Filter;

[NativeName("cycle")]
public byte Cycle;
public MaybeBool<byte> Cycle;

[NativeName("padding1")]
public byte Padding1;
Expand Down
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/GpuColorTargetBlendState.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public partial struct GpuColorTargetBlendState
public byte ColorWriteMask;

[NativeName("enable_blend")]
public byte EnableBlend;
public MaybeBool<byte> EnableBlend;

[NativeName("enable_color_write_mask")]
public byte EnableColorWriteMask;
public MaybeBool<byte> EnableColorWriteMask;

[NativeName("padding1")]
public byte Padding1;
Expand Down
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/GpuColorTargetInfo.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public unsafe partial struct GpuColorTargetInfo
public uint ResolveLayer;

[NativeName("cycle")]
public byte Cycle;
public MaybeBool<byte> Cycle;

[NativeName("cycle_resolve_texture")]
public byte CycleResolveTexture;
public MaybeBool<byte> CycleResolveTexture;

[NativeName("padding1")]
public byte Padding1;
Expand Down
6 changes: 3 additions & 3 deletions sources/SDL/SDL/SDL3/GpuDepthStencilState.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public partial struct GpuDepthStencilState
public byte WriteMask;

[NativeName("enable_depth_test")]
public byte EnableDepthTest;
public MaybeBool<byte> EnableDepthTest;

[NativeName("enable_depth_write")]
public byte EnableDepthWrite;
public MaybeBool<byte> EnableDepthWrite;

[NativeName("enable_stencil_test")]
public byte EnableStencilTest;
public MaybeBool<byte> EnableStencilTest;

[NativeName("padding1")]
public byte Padding1;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/GpuDepthStencilTargetInfo.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public unsafe partial struct GpuDepthStencilTargetInfo
public GpuStoreOp StencilStoreOp;

[NativeName("cycle")]
public byte Cycle;
public MaybeBool<byte> Cycle;

[NativeName("clear_stencil")]
public byte ClearStencil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public unsafe partial struct GpuGraphicsPipelineTargetInfo
public GpuTextureFormat DepthStencilFormat;

[NativeName("has_depth_stencil_target")]
public byte HasDepthStencilTarget;
public MaybeBool<byte> HasDepthStencilTarget;

[NativeName("padding1")]
public byte Padding1;
Expand Down
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/GpuMultisampleState.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public partial struct GpuMultisampleState
public uint SampleMask;

[NativeName("enable_mask")]
public byte EnableMask;
public MaybeBool<byte> EnableMask;

[NativeName("enable_alpha_to_coverage")]
public byte EnableAlphaToCoverage;
public MaybeBool<byte> EnableAlphaToCoverage;

[NativeName("padding2")]
public byte Padding2;
Expand Down
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/GpuRasterizerState.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public partial struct GpuRasterizerState
public float DepthBiasSlopeFactor;

[NativeName("enable_depth_bias")]
public byte EnableDepthBias;
public MaybeBool<byte> EnableDepthBias;

[NativeName("enable_depth_clip")]
public byte EnableDepthClip;
public MaybeBool<byte> EnableDepthClip;

[NativeName("padding1")]
public byte Padding1;
Expand Down
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/GpuSamplerCreateInfo.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public partial struct GpuSamplerCreateInfo
public float MaxLod;

[NativeName("enable_anisotropy")]
public byte EnableAnisotropy;
public MaybeBool<byte> EnableAnisotropy;

[NativeName("enable_compare")]
public byte EnableCompare;
public MaybeBool<byte> EnableCompare;

[NativeName("padding1")]
public byte Padding1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public unsafe partial struct GpuStorageBufferReadWriteBinding
public GpuBufferHandle Buffer;

[NativeName("cycle")]
public byte Cycle;
public MaybeBool<byte> Cycle;

[NativeName("padding1")]
public byte Padding1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public unsafe partial struct GpuStorageTextureReadWriteBinding
public uint Layer;

[NativeName("cycle")]
public byte Cycle;
public MaybeBool<byte> Cycle;

[NativeName("padding1")]
public byte Padding1;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/JoyButtonEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial struct JoyButtonEvent
public byte Button;

[NativeName("down")]
public byte Down;
public MaybeBool<byte> Down;

[NativeName("padding1")]
public byte Padding1;
Expand Down
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/KeyboardEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public partial struct KeyboardEvent
public ushort Raw;

[NativeName("down")]
public byte Down;
public MaybeBool<byte> Down;

[NativeName("repeat")]
public byte Repeat;
public MaybeBool<byte> Repeat;
}
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/MouseButtonEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public partial struct MouseButtonEvent
public byte Button;

[NativeName("down")]
public byte Down;
public MaybeBool<byte> Down;

[NativeName("clicks")]
public byte Clicks;
Expand Down
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/PenButtonEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public partial struct PenButtonEvent
public byte Button;

[NativeName("down")]
public byte Down;
public MaybeBool<byte> Down;
}
4 changes: 2 additions & 2 deletions sources/SDL/SDL/SDL3/PenTouchEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public partial struct PenTouchEvent
public float Y;

[NativeName("eraser")]
public byte Eraser;
public MaybeBool<byte> Eraser;

[NativeName("down")]
public byte Down;
public MaybeBool<byte> Down;
}
2 changes: 1 addition & 1 deletion sources/SDL/SDL/SDL3/TextEditingCandidatesEvent.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public unsafe partial struct TextEditingCandidatesEvent
public int SelectedCandidate;

[NativeName("horizontal")]
public byte Horizontal;
public MaybeBool<byte> Horizontal;

[NativeName("padding1")]
public byte Padding1;
Expand Down
13 changes: 5 additions & 8 deletions sources/SilkTouch/SilkTouch/Mods/TransformFunctions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Silk.NET.SilkTouch.Clang;
using Silk.NET.SilkTouch.Mods.Transformation;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;

Expand All @@ -30,9 +27,9 @@ public class Configuration
public required bool IntReturnsMaybeBool { get; init; }

/// <summary>
/// Types to treat as boolean and their boolean schemes if different to default.
/// Types to treat as boolean and their boolean schemes if different from the default.
/// </summary>
public Dictionary<string, string?>? BoolTypes { get; init; }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saving an allocation is not worth the complexity of null checking. Also, performance difference is negligible either way.

public Dictionary<string, string?> BoolTypes { get; init; } = [];
}

/// <inheritdoc />
Expand Down
Loading
Loading