Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4e867bd
Implement new name affix category approach
Exanite Dec 30, 2025
4a2a4da
Add validation for name affix category configs
Exanite Dec 30, 2025
4a617e4
Adjust API of AddNamePrefix/Suffix extensions and add more docs
Exanite Dec 30, 2025
5d41abe
Update existing name affix identification code to use new API
Exanite Dec 30, 2025
09c55c4
Update enum vendor suffix identification comments to be consistent wi…
Exanite Dec 31, 2025
58babdf
Shorten PrettifyNames.NameAffixes config option to just Affixes
Exanite Dec 31, 2025
c743f1e
Fix incorrect default value for DiscriminatorPriority
Exanite Dec 31, 2025
656c2a9
Shorten name of DiscriminatorPriority configuration option
Exanite Dec 31, 2025
25a64ad
Update generator.json to use new name affix config
Exanite Dec 31, 2025
139ddc8
Add name affix attributes for -Internal (intercepted) and -Raw functions
Exanite Dec 31, 2025
1b28db8
Fix incorrect parameter order (oops)
Exanite Dec 31, 2025
3ebfbeb
Configure RawFunction and InterceptedFunction categories
Exanite Dec 31, 2025
9b351b5
Redesign config and begin updating implementation to support new config
Exanite Jan 1, 2026
d160d8b
New name affix config compiles, but logic has not been updated
Exanite Jan 1, 2026
d51fe8b
Update name affix configs in generator.json
Exanite Jan 1, 2026
1ad47d5
Update name affix removal/application code to work with new config
Exanite Jan 1, 2026
e00365a
Fix incorrect sort order
Exanite Jan 1, 2026
8baad9b
Prevent empty "ungroupable" enums from being output and fix EnumGroup…
Exanite Jan 2, 2026
617938a
Update Silk.NET 2.X submodule for website
dotnet-bot Jan 2, 2026
2acffd9
[3.0] Rewrite the SilkTouch cache implementation to actually work (#2…
Perksey Jan 2, 2026
fdbbc9a
Add temporary hack to fix -OES being trimmed as -O issue
Exanite Jan 3, 2026
867ae6e
Merge remote-tracking branch 'dotnet/Silk.NET/develop/3.0' into featu…
Exanite Jan 3, 2026
5a59979
Regenerate on Windows and remove old cache files
Exanite Jan 3, 2026
cf9bbfa
Update Silk.NET 2.X submodule for website
dotnet-bot Jan 5, 2026
6b9cdda
Reorder KhronosVendor suffixes to be last
Exanite Jan 5, 2026
7eaa45c
Merge branch 'develop/3.0' into feature/csharpier-files-modified-by-m…
Exanite Jan 5, 2026
4dffd37
Format all files changed in my name improvements set of PRs
Exanite Jan 6, 2026
548c482
Format again by rerunning exact same command as previous commit
Exanite Jan 6, 2026
e2fd822
Rewrite NameAffix arg parsing code to look better under CSharpier for…
Exanite Jan 6, 2026
d6bddf9
Merge pull request #25 from Exanite/feature/csharpier-files-modified-…
Exanite Jan 7, 2026
600a199
Merge pull request #24 from Exanite/feature/khronos-vendor-last
Exanite Jan 7, 2026
59eb9f4
Merge pull request #23 from Exanite/feature/name-affixes-categories-u…
Exanite Jan 7, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Restore
run: dotnet restore --runtime ${{ matrix.rid }}
- name: Test
run: dotnet test -c Release --no-restore --runtime ${{ matrix.rid }} --collect:"XPlat Code Coverage" --results-directory ./coverage --logger:"trx"
run: dotnet test --results-directory coverage --coverage --coverage-output-format cobertura --report-trx -c Release
# TODO: https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
#- name: Test Report
# uses: dorny/test-reporter@v1
Expand Down
Binary file removed .silktouch/91c9aa14a031651f.stout
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 7 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.14.28" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
<PackageVersion Include="NUnit3TestAdapter" Version="5.2.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="6.0.1" />
<PackageVersion Include="NUnit.Analyzers" Version="4.11.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="NUnit" Version="4.4.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<!-- eng/benchmarks -->
<PackageVersion Include="BenchmarkDotNet" Version="0.15.6" />
Expand Down Expand Up @@ -40,8 +40,11 @@
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="10.0.0" />
<PackageVersion Include="System.IO.Hashing" Version="10.0.0" />
<!-- SilkTouch Unit Tests -->
<PackageVersion Include="Silk.NET.BuildTools" Version="2.22.0" />
<PackageVersion Include="Silk.NET.BuildTools" Version="2.23.0-pr2526.5226" />
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
<PackageVersion Include="Verify.NUnit" Version="31.6.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="2.0.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.1.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="8.0.2" />
</ItemGroup>
</Project>
</Project>
31 changes: 11 additions & 20 deletions eng/build/Build.Publishing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,21 @@ partial class Build

AbsolutePath OutputPackageDir => RootDirectory / "artifacts" / "pkg";

private void RemoveTemporaryFeeds()
{
try
{
if (DotNet("nuget list source").Any(x => x.Text.Contains(TemporaryNuGetFeed)))
{
DotNet($"nuget remove source \"{TemporaryNuGetFeed}\"");
}
}
catch
{
// probably hasn't existed yet, don't care.
}
}
AbsolutePath NuGetConfigFile => TemporaryDirectory / "push.nuget.config";

private void RemoveTemporaryFeeds() => NuGetConfigFile.DeleteFile();

private IEnumerable<Output> AddTemporaryFeed()
{
if (NugetFeed.Contains("nuget.org"))
{
return [];
}
NuGetConfigFile.WriteAllText(
"<?xml version=\"1.0\" encoding=\"utf-8\"?><configuration><packageSources><clear />"
+ "</packageSources></configuration>"
);

var srcSettings = new DotNetNuGetAddSourceSettings()
.SetName(TemporaryNuGetFeed)
.SetSource(NugetFeed);
.SetSource(NugetFeed)
.SetConfigFile(NuGetConfigFile);

if (NugetUsername is null != NugetPassword is null)
{
Expand Down Expand Up @@ -130,7 +120,8 @@ DotNetNuGetPushSettings NuGetPushSettings
var ret = new DotNetNuGetPushSettings()
.SetNoServiceEndpoint(NugetNoServiceEndpoint)
.EnableSkipDuplicate()
.SetSource(NugetFeed.Contains("nuget.org") ? "nuget.org" : TemporaryNuGetFeed);
.SetSource(NugetFeed.Contains("nuget.org") ? "nuget.org" : TemporaryNuGetFeed)
.AddProcessAdditionalArguments("--configfile", NuGetConfigFile);
if (NugetApiKey is not null)
{
ret = ret.SetApiKey(NugetApiKey);
Expand Down
2 changes: 1 addition & 1 deletion eng/submodules/silk.net-2.x
Submodule silk.net-2.x updated 2948 files
96 changes: 71 additions & 25 deletions generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"Jobs": {
"Microsoft": {
"Solution": "Silk.NET.sln",
"SourceProject": "TODO.csproj",
"TestProject": "tests/TODO.csproj",
"SourceProject": "sources/Win32/Win32/Silk.NET.Win32.csproj",
"TestProject": "tests/Win32/Win32/Silk.NET.Win32.UnitTests.csproj",
"DefaultLicenseHeader": "eng/silktouch/header.txt",
"Mods": [
"AddIncludes",
Expand All @@ -18,7 +18,8 @@
"sources/Windows/um/icm/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/icm/Windows.cs",
"sources/Gdiplus/um/gdiplustypes/GpRect.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpRect.cs",
"sources/Gdiplus/um/gdiplustypes/GpRectF.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpRectF.cs",
"sources/Gdiplus/um/gdiplustypes/GpPathData.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpPathData.cs"
"sources/Gdiplus/um/gdiplustypes/GpPathData.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpPathData.cs",
"sources/Windows/shared/strsafe/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/shared/strsafe/Windows.gen.cs"
},
"InputSourceRoot": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows",
"InputTestRoot": "eng/submodules/terrafx.interop.windows/tests/Interop/Windows",
Expand Down Expand Up @@ -57,13 +58,9 @@
"InputSourceRoot": "sources/SDL",
"InputTestRoot": "tests/SDL"
},
"ExtractNestedTyping": {
"DelegateSuffixOrder": 1
},
"TransformHandles": {
"AssumeMissingTypesOpaque": true,
"UseDSL": true,
"HandleSuffixOrder": 1
"UseDSL": true
},
"TransformFunctions": {
"BoolTypes": {
Expand Down Expand Up @@ -154,9 +151,9 @@
"PathRenderingTokenNV": "byte",
"PathCoordType": "byte"
},
"TrimFunctionDataTypes": true,
"TrimEnumTypeNonExclusiveVendors": true,
"TrimEnumMemberImpliedVendors": true
"IdentifyFunctionDataTypes": true,
"IdentifyEnumTypeNonExclusiveVendors": true,
"IdentifyEnumMemberImpliedVendors": true
},
"AddVTables": {
"VTables": [
Expand All @@ -181,6 +178,26 @@
"OcclusionQueryParameterNameNV": "GL",
"TexStorageAttribs": "GL",
"ContainerType": "GL"
},
"Affixes": {
"HandleType": {
"Order": 1
},
"FunctionPointerDelegateType": {
"Order": 1
},
"KhronosVendor": {
"Order": -1
},
"KhronosFunctionDataType": {
"IsDiscriminator": true
},
"KhronosImpliedVendor": {
"Remove": true
},
"KhronosNonExclusiveVendor": {
"Remove": true
}
}
},
"TransformEnums": {
Expand Down Expand Up @@ -248,9 +265,9 @@
"NonVendorSuffixes": [
"Direct"
],
"TrimFunctionDataTypes": true,
"TrimEnumTypeNonExclusiveVendors": true,
"TrimEnumMemberImpliedVendors": true
"IdentifyFunctionDataTypes": true,
"IdentifyEnumTypeNonExclusiveVendors": true,
"IdentifyEnumMemberImpliedVendors": true
},
"InterceptNativeFunctions": {
"NativeFunctionNames": [
Expand Down Expand Up @@ -297,6 +314,26 @@
"EAXGetDirect": "EAXGetDirect",
"EAXGetBufferModeDirect": "EAXGetBufferModeDirect",
"EAXSetBufferModeDirect": "EAXSetBufferModeDirect"
},
"Affixes": {
"HandleType": {
"Order": 1
},
"FunctionPointerDelegateType": {
"Order": 1
},
"KhronosVendor": {
"Order": -1
},
"KhronosFunctionDataType": {
"IsDiscriminator": true
},
"KhronosImpliedVendor": {
"Remove": true
},
"KhronosNonExclusiveVendor": {
"Remove": true
}
}
},
"TransformEnums": {
Expand All @@ -312,11 +349,7 @@
},
"TransformHandles": {
"AssumeMissingTypesOpaque": true,
"UseDSL": true,
"HandleSuffixOrder": 1
},
"ExtractNestedTyping": {
"DelegateSuffixOrder": 1
"UseDSL": true
},
"StripAttributes": {
"Remove": [
Expand Down Expand Up @@ -361,9 +394,6 @@
}
]
},
"ExtractNestedTyping": {
"DelegateSuffixOrder": 1
},
"MixKhronosData": {
"SpecPath": "eng/submodules/vulkan/xml/vk.xml",
"Namespace": "Silk.NET.Vulkan",
Expand All @@ -376,7 +406,7 @@
"VK_VENDOR_ID_VSI",
"VK_VENDOR_ID_MESA"
],
"TrimEnumMemberImpliedVendors": true
"IdentifyEnumMemberImpliedVendors": true
},
"InterceptNativeFunctions": {
"NativeFunctionNames": [
Expand All @@ -391,15 +421,31 @@
},
"TransformHandles": {
"AssumeMissingTypesOpaque": true,
"UseDSL": true,
"HandleSuffixOrder": 1
"UseDSL": true
},
"PrettifyNames": {
"LongAcronymThreshold": 4,
"GlobalPrefixHints": ["PFN_vk","vk"],
"PrefixOverrides": {
"VkPipelineCreateFlags2": "VK_PIPELINE_CREATE_2",
"VkMemoryDecompressionMethodFlagsEXT": "VK_MEMORY_DECOMPRESSION_METHOD"
},
"Affixes": {
"HandleType": {
"Order": 1
},
"FunctionPointerDelegateType": {
"Order": 1
},
"KhronosVendor": {
"Order": -1
},
"KhronosImpliedVendor": {
"Remove": true
},
"KhronosHandleType": {
"Remove": true
}
}
},
"TransformEnums": {
Expand Down
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"sdk": {
"version": "10.0.100",
"rollForward": "major"
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
16 changes: 16 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Silk.NET Experimental Feed" value="https://dotnet.github.io/Silk.NET/nuget/experimental/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="Silk.NET Experimental Feed">
<package pattern="Silk.NET.*" />
</packageSource>
</packageSourceMapping>
</configuration>
52 changes: 14 additions & 38 deletions sources/Core/Core/Annotations/NameAffixAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Silk.NET.Core;
/// </summary>
[AttributeUsage(
AttributeTargets.Class
| AttributeTargets.Delegate
| AttributeTargets.Enum
| AttributeTargets.Field
| AttributeTargets.Method
| AttributeTargets.Parameter
| AttributeTargets.Property
| AttributeTargets.Struct,
| AttributeTargets.Delegate
| AttributeTargets.Enum
| AttributeTargets.Field
| AttributeTargets.Method
| AttributeTargets.Parameter
| AttributeTargets.Property
| AttributeTargets.Struct,
AllowMultiple = true,
Inherited = true
)]
Expand All @@ -23,12 +23,11 @@ public sealed class NameAffixAttribute : Attribute
/// <summary>
/// Creates a new NameAffix attribute.
/// </summary>
public NameAffixAttribute(string type, string affix, int order, int discriminatorPriority)
public NameAffixAttribute(string type, string category, string affix)
{
Type = type;
Category = category;
Affix = affix;
Order = order;
DiscriminatorPriority = discriminatorPriority;
}

/// <summary>
Expand All @@ -37,38 +36,15 @@ public NameAffixAttribute(string type, string affix, int order, int discriminato
public string Type { get; }

/// <summary>
/// The affix of the identifier.
/// </summary>
public string Affix { get; }

/// <summary>
/// The order with which the affix is applied.
/// <para/>
/// Negative means the affix is not reapplied after trimming.
/// Higher means the affix is applied first.
/// <para/>
/// Affixes with the same order have ties broken using the order they are declared on the identifier.
/// First declared are applied first.
/// The category of the affix.
/// </summary>
/// <remarks>
/// SilkTouch mods setting this property should use either -1, 0, or a value specified through the mod's configuration.
/// This is to reduce the hardcoding of values and to make the mods more applicable to different sets of bindings.
/// This is used to identify which name affix configuration is used to process this affix.
/// </remarks>
public int Order { get; }
public string Category { get; }

/// <summary>
/// The priority with which the affix is used
/// to create secondary names in case of conflicts.
/// <para/>
/// Negative means the affix is required, but won't be used to create secondaries.
/// Non-negative means the affix is optional, but will be used to create secondaries.
/// Higher means the names created using the affix is tried first.
/// <para/>
/// Affixes with the same priority are applied together as a group.
/// The affix of the identifier.
/// </summary>
/// <remarks>
/// SilkTouch mods setting this property should use either -1, 0, or a value specified through the mod's configuration.
/// This is to reduce the hardcoding of values and to make the mods more applicable to different sets of bindings.
/// </remarks>
public int DiscriminatorPriority { get; }
public string Affix { get; }
}
Loading