Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
184cc4c
Initial commit for feature/silktouch-config-overhaul
Exanite Oct 10, 2026
3405c81
Add Autofac and adapt the existing IServiceCollection code to use it
Exanite Oct 9, 2026
a2ea251
Remove EvaluatedConstant since this is old code and we can evaluate u…
Exanite Oct 9, 2026
f80e35e
Begin removing keyed resolution and JSON config reading code
Exanite Oct 9, 2026
b9ae265
Remove IJobDependency/JobDependencies
Exanite Oct 10, 2026
a194659
Begin reworking SilkTouchGenerator
Exanite Oct 10, 2026
f023180
Combine IModContextProvider and IModContext because Provider's main j…
Exanite Oct 10, 2026
9ac4f73
Update mods to not use IOptionsSnapshot nor IJobDependency
Exanite Oct 10, 2026
6f8e8e5
Trim ServiceCollectionExtensions to isolate the code I need to keep
Exanite Oct 10, 2026
3063d6b
Work on new composition root
Exanite Oct 10, 2026
7ac194b
Get new setup roughly implemented and fix all compile errors
Exanite Oct 10, 2026
b9eb866
Remove old generator Resolve call
Exanite Oct 10, 2026
8c538e8
Removes jobs from SilkTouchConfiguration and fix private field naming
Exanite Oct 10, 2026
ad3bee4
Remove unhelpful doc
Exanite Oct 10, 2026
349287e
Add ModRegistrationExtensions
Exanite Oct 10, 2026
da27c07
Add RegisterMod helper
Exanite Oct 10, 2026
e2c3c1e
Add RegisterClangScraper
Exanite Oct 10, 2026
a238c05
Use collection expressions for CLI option definitions
Exanite Oct 10, 2026
fa374bb
Fix Program class not being static
Exanite Oct 10, 2026
5c93619
Implement generator job parallelism setting
Exanite Oct 10, 2026
a1dca27
Work on registration API
Exanite Oct 10, 2026
7dabae1
Translate Vulkan job JSON into C#
Exanite Oct 10, 2026
2f544d3
Replace RegisterMod helper with AsHierarchyAndInterfaces
Exanite Oct 10, 2026
1addf94
Add separate SilkTouchModRegistrationContext for registering mods
Exanite Oct 10, 2026
dc09ae0
Move function transformer registrations to TransformFunctions registr…
Exanite Oct 10, 2026
c5922a7
Also register FunctionTransformer alongside TransformFunctions
Exanite Oct 10, 2026
01ebbd8
Use WithParameter to specifically inject the config param into each m…
Exanite Oct 10, 2026
3e34bea
Update CSharpier tool
Exanite Oct 10, 2026
f9f94ef
Format SilkTouchRegistrationExtensions
Exanite Oct 10, 2026
0ab9db2
Add extra spacing since CSharpier formatting is hard to read with flu…
Exanite Oct 10, 2026
0670ebc
Remove "DON'T USE CONSTRUCTOR-STYLE RECORDS" warning comments, no lon…
Exanite Oct 10, 2026
b5efbb6
Change AddVTables Configuration to accept VTable types instead of ICo…
Exanite Oct 10, 2026
8a2256b
Add IModContextProvider back, but rename to IModContextFactory
Exanite Oct 11, 2026
4633023
Fix incorrect generator config
Exanite Oct 11, 2026
522e960
Migrate MS DI registration to use Autofac
Exanite Oct 11, 2026
82e7367
Add SilkTouchHost class
Exanite Oct 11, 2026
e879ba6
Move Vulkan job definition to Program from SilkTouchHost
Exanite Oct 11, 2026
e855ec5
Add todos and edit docs
Exanite Oct 11, 2026
9674bf8
Rename parameter
Exanite Oct 11, 2026
e2f5d7c
Add new Silk.NET.SilkTouch.Jobs project
Exanite Oct 11, 2026
67fd5f6
Migrate generator.json jobs to SilkTouch.Jobs
Exanite Oct 11, 2026
12e24f3
Split jobs into multiple files for readability and to save my scroll …
Exanite Oct 11, 2026
451c592
Fix compile errors in SilkTouch test project
Exanite Oct 11, 2026
bc08a3a
Fix incorrect default AddVTables config
Exanite Oct 12, 2026
1c44723
Remove usages ThreadLocals and JobKey when used for keyed resolution/…
Exanite Oct 12, 2026
da2b65f
Remove more job key usages
Exanite Oct 12, 2026
7d6858d
Cleanup a few more job key usages
Exanite Oct 12, 2026
a8599a2
Change SilkTouchJob to be internal
Exanite Oct 12, 2026
7df9a65
Add registration methods for the different function transformers and …
Exanite Oct 12, 2026
09f119a
Generate all bindings except Microsoft on Windows
Exanite Oct 12, 2026
0fc0189
Add start of DocumentFactory
Exanite Oct 12, 2026
24ca9a7
Work on DocumentFactory
Exanite Oct 12, 2026
fd34b7e
Work on DocumentFactory API
Exanite Oct 12, 2026
6167199
Ensure using directives are well ordered
Exanite Oct 12, 2026
948603c
Implement DocumentFactory syntax walker and rewriter
Exanite Oct 12, 2026
18ce58b
Add using statement sorting to DocumentFactory
Exanite Oct 12, 2026
60d5e1b
Register DocumentFactory by default
Exanite Oct 12, 2026
4fb13e5
Handle headers during document initialization
Exanite Oct 12, 2026
78dc049
Remove a few usages of ModCSharpSyntaxRewriter
Exanite Oct 13, 2026
3a87296
Fix incorrect using directive sort order
Exanite Oct 13, 2026
37eb2c4
Initialize the DocumentFactory with the default license header
Exanite Oct 13, 2026
f1c3e91
Remove Mod class (not IMod)
Exanite Oct 13, 2026
8f56dd6
Replace common namespace identification with a DefaultNamespace confi…
Exanite Oct 13, 2026
e6ea216
Assume base.VisitCompilationUnit does not return null
Exanite Oct 13, 2026
6dce1c1
Have DocumentFactory add a default namespace to documents without them
Exanite Oct 13, 2026
839d852
Remove header injection handling from MSBuildModContext
Exanite Oct 13, 2026
e685bce
Update IModContext.WorkingDirectory doc comment
Exanite Oct 13, 2026
f595bc3
Work on removing ModCSharpSyntaxRewriter
Exanite Oct 13, 2026
d75e06a
Update remaining usages of ModCSharpSyntaxRewriter
Exanite Oct 13, 2026
16c3027
Update mods to use DocumentFactory when adding documents
Exanite Oct 13, 2026
ae62503
Fix duplicated doc header
Exanite Oct 13, 2026
921920d
Move SDL3 header txt up one level to match the other bindings
Exanite Oct 13, 2026
df689d1
Change DefaultLicenseHeader to specify the API-specific header file f…
Exanite Oct 13, 2026
495b695
Edit doc comment
Exanite Oct 13, 2026
2aa1d22
Update and fix unit tests
Exanite Oct 13, 2026
7ec6e9d
Regenerate all bindings except Microsoft on Windows
Exanite Oct 13, 2026
5e069f3
Have AddVTables add using System.Runtime.CompilerServices to all vtab…
Exanite Oct 13, 2026
46b5904
Rework how using statements are gathered (WIP)
Exanite Oct 13, 2026
e9ff48a
Rework how ClangScraper outputs documents
Exanite Oct 13, 2026
d19f8b8
Cleanup
Exanite Oct 13, 2026
180bc57
Unify the scrape and read from cache paths of ClangScraper
Exanite Oct 13, 2026
70b412e
Fix source documents being dropped
Exanite Oct 13, 2026
f636e7e
Fix using statement formatting
Exanite Oct 14, 2026
f92f7cc
Isolate using statements added by AddVTables
Exanite Oct 14, 2026
aa1a059
Regenerate all bindings except Microsoft on Windows
Exanite Oct 14, 2026
79a8be4
Move solution loading back to MSBuildModContextFactory
Exanite Oct 14, 2026
03427ec
Fix solution cache race condition causing the solution to be loaded m…
Exanite Oct 14, 2026
643a992
Edit docs for SilkTouchHost
Exanite Oct 14, 2026
d087d6e
Update the using-the-generator docs
Exanite Oct 14, 2026
ef1fb43
Update generator-mods docs
Exanite Oct 14, 2026
a8c5b55
Fix incorrect branch used for docs links
Exanite Oct 14, 2026
dbda599
Move GetLongestCommonPrefix and GetLongestCommonPath to ClangScraper
Exanite Oct 14, 2026
d8bef8e
Remove WithMods
Exanite Oct 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.29.2",
"version": "1.3.0",
"commands": [
"dotnet-csharpier"
]
"csharpier"
],
"rollForward": false
}
}
}
Binary file modified .silktouch/openal-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/opencl-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/opengl-clangsharp.stout
Binary file not shown.
Binary file modified .silktouch/openxr-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.
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<!-- Analyzers -->
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
<!-- SilkTouch -->
<PackageVersion Include="Autofac" Version="9.3.4" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="11.0.2" />
<PackageVersion Include="ClangSharp.PInvokeGenerator" Version="21.1.8.4" />
<PackageVersion Include="CSharpier.Core" Version="1.3.0" />
<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
Expand Down
188 changes: 94 additions & 94 deletions Silk.NET.slnx
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
<Solution>
<Folder Name="/docs/">
<File Path="docs/CHANGELOG.md" />
<File Path="docs/CODEOWNERS" />
<File Path="docs/CODE_OF_CONDUCT.md" />
<File Path="docs/CONTRIBUTING.md" />
<File Path="docs/README.md" />
</Folder>
<Folder Name="/eng/">
<Project Path="eng/build/Silk.NET.NUKE.csproj" />
</Folder>
<Folder Name="/eng/benchmarks/">
<Project Path="eng/benchmarks/Silk.NET.Maths.Benchmarks/Silk.NET.Maths.Benchmarks.csproj" />
</Folder>
<Folder Name="/examples/" />
<Folder Name="/examples/CSharp/" />
<Folder Name="/examples/CSharp/OpenAL/">
<Project Path="examples/CSharp/OpenAL/Tutorial001.HelloSound/OpenAL.Tutorial001.HelloSound.csproj" />
</Folder>
<Folder Name="/docs/">
Comment thread
Exanite marked this conversation as resolved.
<File Path="docs/CHANGELOG.md" />
<File Path="docs/CODEOWNERS" />
<File Path="docs/CODE_OF_CONDUCT.md" />
<File Path="docs/CONTRIBUTING.md" />
<File Path="docs/README.md" />
</Folder>
<Folder Name="/eng/">
<Project Path="eng/build/Silk.NET.NUKE.csproj" />
</Folder>
<Folder Name="/eng/benchmarks/">
<Project Path="eng/benchmarks/Silk.NET.Maths.Benchmarks/Silk.NET.Maths.Benchmarks.csproj" />
</Folder>
<Folder Name="/examples/" />
<Folder Name="/examples/CSharp/" />
<Folder Name="/examples/CSharp/OpenAL/">
<Project Path="examples/CSharp/OpenAL/Tutorial001.HelloSound/OpenAL.Tutorial001.HelloSound.csproj" />
</Folder>
<Folder Name="/examples/CSharp/OpenCL/">
<Project Path="examples/CSharp/OpenCL/Tutorial001.SimpleKernel/OpenCL.Tutorial001.SimpleKernel.csproj" />
</Folder>
<Folder Name="/examples/CSharp/SDL/">
<Project Path="examples/CSharp/SDL/Tutorial001.HelloWindow/SDL.Tutorial001.HelloWindow.csproj" />
</Folder>
<Folder Name="/scripts/">
<File Path="scripts/azure-pipelines.yml" />
<File Path="scripts/build.ps1" />
<File Path="scripts/build.sh" />
<File Path="scripts/cibuild.cmd" />
<File Path="scripts/cibuild.sh" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="generator.json" />
<File Path="LICENSE.md" />
<File Path="Silk.NET.sln.DotSettings" />
</Folder>
<Folder Name="/sources/">
<File Path="sources/Directory.Build.props" />
<File Path="sources/Directory.Build.targets" />
<Project Path="sources/Playground/Playground.csproj" />
</Folder>
<Folder Name="/sources/Core/">
<Project Path="sources/Core/Core/Silk.NET.Core.csproj" />
<Project Path="sources/Core/Silk.NET/Silk.NET.csproj" />
</Folder>
<Folder Name="/sources/Maths/">
<Project Path="sources/Maths/Maths/Silk.NET.Maths.csproj" />
</Folder>
<Folder Name="/sources/OpenAL/">
<Project Path="sources/OpenAL/OpenAL/Silk.NET.OpenAL.csproj" />
<Project Path="sources/OpenAL/Soft.Native/Silk.NET.OpenAL.Soft.Native.csproj" />
</Folder>
<Folder Name="/sources/OpenCL/">
<Project Path="sources/OpenCL/OpenCL/Silk.NET.OpenCL.csproj" />
</Folder>
<Folder Name="/sources/OpenGL/">
<Project Path="sources/OpenGL/OpenGL/Silk.NET.OpenGL.csproj" />
</Folder>
<Folder Name="/sources/OpenXR/">
<Project Path="sources/OpenXR/OpenXR/Silk.NET.OpenXR.csproj" />
</Folder>
<Folder Name="/sources/SDL/">
<Project Path="sources/SDL/Native/Silk.NET.SDL.Native.csproj" />
<Project Path="sources/SDL/SDL/Silk.NET.SDL.csproj" />
</Folder>
<Folder Name="/sources/SilkTouch/">
<Project Path="sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj" />
</Folder>
<Folder Name="/sources/Vulkan/">
<Project Path="sources/Vulkan/Vulkan/Silk.NET.Vulkan.csproj" />
</Folder>
<Folder Name="/sources/Win32/" />
<Folder Name="/sources/Windowing/">
<Project Path="sources/Windowing/Windowing/Silk.NET.Windowing.csproj" />
</Folder>
<Folder Name="/tests/">
<File Path="tests/Directory.Build.props" />
<File Path="tests/Directory.Build.targets" />
</Folder>
<Folder Name="/tests/Core/">
<Project Path="tests/Core/Core/Silk.NET.Core.UnitTests.csproj" />
</Folder>
<Folder Name="/tests/Maths/">
<Project Path="tests/Maths/Maths/Silk.NET.Maths.Tests.csproj" />
</Folder>
<Folder Name="/tests/SDL/">
<Project Path="tests/SDL/SDL/Silk.NET.SDL.UnitTests.csproj" />
</Folder>
<Folder Name="/tests/SilkTouch/">
<Project Path="tests/SilkTouch/SilkTouch/Silk.NET.SilkTouch.UnitTests.csproj" />
</Folder>
<Folder Name="/examples/CSharp/SDL/">
<Project Path="examples/CSharp/SDL/Tutorial001.HelloWindow/SDL.Tutorial001.HelloWindow.csproj" />
</Folder>
<Folder Name="/scripts/">
<File Path="scripts/azure-pipelines.yml" />
<File Path="scripts/build.ps1" />
<File Path="scripts/build.sh" />
<File Path="scripts/cibuild.cmd" />
<File Path="scripts/cibuild.sh" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="LICENSE.md" />
<File Path="Silk.NET.sln.DotSettings" />
</Folder>
<Folder Name="/sources/">
<File Path="sources/Directory.Build.props" />
<File Path="sources/Directory.Build.targets" />
<Project Path="sources/Playground/Playground.csproj" />
</Folder>
<Folder Name="/sources/Core/">
<Project Path="sources/Core/Core/Silk.NET.Core.csproj" />
<Project Path="sources/Core/Silk.NET/Silk.NET.csproj" />
</Folder>
<Folder Name="/sources/Maths/">
<Project Path="sources/Maths/Maths/Silk.NET.Maths.csproj" />
</Folder>
<Folder Name="/sources/OpenAL/">
<Project Path="sources/OpenAL/OpenAL/Silk.NET.OpenAL.csproj" />
<Project Path="sources/OpenAL/Soft.Native/Silk.NET.OpenAL.Soft.Native.csproj" />
</Folder>
<Folder Name="/sources/OpenCL/">
<Project Path="sources/OpenCL/OpenCL/Silk.NET.OpenCL.csproj" />
</Folder>
<Folder Name="/sources/OpenGL/">
<Project Path="sources/OpenGL/OpenGL/Silk.NET.OpenGL.csproj" />
</Folder>
<Folder Name="/sources/OpenXR/">
<Project Path="sources/OpenXR/OpenXR/Silk.NET.OpenXR.csproj" />
</Folder>
<Folder Name="/sources/SDL/">
<Project Path="sources/SDL/Native/Silk.NET.SDL.Native.csproj" />
<Project Path="sources/SDL/SDL/Silk.NET.SDL.csproj" />
</Folder>
<Folder Name="/sources/SilkTouch/">
<Project Path="sources/SilkTouch/Jobs/Silk.NET.SilkTouch.Jobs.csproj" />
<Project Path="sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj" />
</Folder>
<Folder Name="/sources/Vulkan/">
<Project Path="sources/Vulkan/Vulkan/Silk.NET.Vulkan.csproj" />
</Folder>
<Folder Name="/sources/Win32/" />
<Folder Name="/sources/Windowing/">
<Project Path="sources/Windowing/Windowing/Silk.NET.Windowing.csproj" />
</Folder>
<Folder Name="/tests/">
<File Path="tests/Directory.Build.props" />
<File Path="tests/Directory.Build.targets" />
</Folder>
<Folder Name="/tests/Core/">
<Project Path="tests/Core/Core/Silk.NET.Core.UnitTests.csproj" />
</Folder>
<Folder Name="/tests/Maths/">
<Project Path="tests/Maths/Maths/Silk.NET.Maths.Tests.csproj" />
</Folder>
<Folder Name="/tests/SDL/">
<Project Path="tests/SDL/SDL/Silk.NET.SDL.UnitTests.csproj" />
</Folder>
<Folder Name="/tests/SilkTouch/">
<Project Path="tests/SilkTouch/SilkTouch/Silk.NET.SilkTouch.UnitTests.csproj" />
</Folder>
</Solution>
26 changes: 12 additions & 14 deletions docs/for-contributors/Generator/generator-mods.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ ideally, no communication is done at all so that mods are kept completely standa

### Mod Configuration

Mods are configured through the generator config JSON file. Silk's config file is named `generator.json` and is located
at the root of the Silk.NET repository. This config file can be used as reference for your own config files. In
addition, most mods have a configuration class located in their source code with additional documentation.
Mods are configured as part of bindings generation jobs in a separate C# project. Silk's own configuration project is
the
[`Silk.NET.SilkTouch.Jobs`](https://github.com/dotnet/Silk.NET/blob/develop/3.0/sources/SilkTouch/Jobs/Program.cs)
project. This project can be used as reference for your own SilkTouch configuration projects. More information about
using the SilkTouch generator can be found in the [Using the Generator](using-the-generator.md) documentation.

## Available Mods

Expand Down Expand Up @@ -186,7 +188,7 @@ development and iteration, the generator is typically set up so that platform-sp

Usage recommendations:

This mod is configured differently from the rest of the mods. The JSON mod configuration follows the same pattern as the
This mod is configured differently from the rest of the mods. The C# mod configuration follows the same pattern as the
rest of the mods, but the bulk of the configuration comes in the form of `.rsp` files. These `.rsp` files represent the
command line arguments passed to ClangSharpPInvokeGenerator. More information about how to use this mod and how to
configure the generator as a whole is found in the [Using the Generator](using-the-generator.md) documentation.
Expand Down Expand Up @@ -373,16 +375,12 @@ Name affix categories:

Example name affix configurations for `PrettifyNames`:

```
"SharedPrefix": {
"Remove": true
}
```cs
["SharedPrefix"] = new() { Remove = true },
```

```
"SharedPrefix": {
"IsDiscriminator": true
}
```cs
["SharedPrefix"] = new() { IsDiscriminator = true },
```

Usage recommendations:
Expand Down Expand Up @@ -465,8 +463,8 @@ This is a monolithic mod that handles behavior specific to Khronos-style APIs su

Because this mod is intended more for internal use rather than public use, the documentation here will focus on
decisions made during the development of the mod and other internal details rather than the exact usage of the mod.
For information relating to how the mod should be used, please use Silk's `generator.json` configuration, source code,
and `MixKhronosDataTests` as a reference.
For information relating to how the mod should be used, please use Silk's own configuration, source code, and
`MixKhronosDataTests` as a reference.

(TODO: Document major decisions relating to `MixKhronosData`. This is difficult because of the mod's long development
history, and while this section is already massive, it still does not cover everything the mod does. This should be done
Expand Down
33 changes: 18 additions & 15 deletions docs/for-contributors/Generator/using-the-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Metal.

There are three main things to configure:

1. Silk 3 - This is the [`generator.json`](https://github.com/dotnet/Silk.NET/blob/develop/3.0/generator.json) file.
1. Silk 3 - This is the [`Silk.NET.SilkTouch.Jobs`](https://github.com/dotnet/Silk.NET/blob/develop/3.0/sources/SilkTouch/Jobs/Program.cs)
project. You may also use a single file app instead of a full C# project.

2. ClangSharpPInvokeGenerator - This is the [`eng/silktouch`](https://github.com/dotnet/Silk.NET/tree/develop/3.0/eng/silktouch) folder.

Expand All @@ -32,9 +33,13 @@ you are binding.

## SilkTouch Configuration

Silk defines the configuration for SilkTouch in the
[`generator.json`](https://github.com/dotnet/Silk.NET/blob/develop/3.0/generator.json) file. This file defines the
different bindings jobs and the list of mods to run for each job.
Silk defines the configuration for SilkTouch as regular C# in the
Comment thread
Perksey marked this conversation as resolved.
[`Silk.NET.SilkTouch.Jobs`](https://github.com/dotnet/Silk.NET/blob/develop/3.0/sources/SilkTouch/Jobs/Program.cs)
project.

This project defines the different bindings jobs and the list of mods to run for each job. Silk's own bindings jobs are
split into multiple files for maintainability, but since this is regular C# code, you may organize your own job
definitions however you wish.

For example, when binding to a C API:

Expand All @@ -48,8 +53,8 @@ For example, when binding to a C API:

Aside from reading documentation, some other ways to learn about the mods are to:

- Read through the tests. The tests act as examples for specific behaviors expected by each mod, with configurations,
inputs, and expected outputs provided for each case.
- Read through the SilkTouch tests. The tests act as examples for specific behaviors expected by each mod, with
configurations, inputs, and expected outputs provided for each case.

- Add them one by one. Mods run in the order you define them and work off the output of the previous mod.

Expand Down Expand Up @@ -105,7 +110,9 @@ eng
- SDL3
```

Profiles likely will not be relevent for most C APIs, so the examples here will keep focusing on the SDL case.
Profiles are not likely to be required for your average C API required, so the examples here will keep focusing on the
SDL case. Profiles are needed when your API has multiple variants or needs to be generated on multiple platforms. For
additional reference, please use the OpenGL (TODO: or OpenXR bindings) bindings jobs as examples.

The following is the folder structure used for Silk's SDL bindings. You do not have to structure it the way Silk does.
Silk's structure focuses on keeping consistency in its response file organization, regardless of whether the API makes
Expand All @@ -117,8 +124,8 @@ eng
- sdl
- SDL3
- generate.rsp <-- The main settings file. Used as the entrypoint. All import paths must be relative to this file.
- header.txt
- sdl-SDL.h <-- Handwritten header file that #includes the relevant headers of the library you want to bind.
- header.txt
- remap.rsp
- settings.rsp <-- Shared settings for all profiles.
```
Expand Down Expand Up @@ -164,7 +171,7 @@ Silk.NET.SDL
--define-macro
TODO_DEFINE_MACROS=HERE
--headerFile
header.txt
Comment thread
Exanite marked this conversation as resolved.
../header.txt
--include-directory
../../../submodules/sdl/include
--with-callconv
Expand Down Expand Up @@ -238,23 +245,19 @@ MSBuild under the hood.
The generator can be run directly from source using the following command:

```sh
dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -c Release -- generator.json --only SDL
dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.Jobs.csproj -c Release -- --only SDL
```

You may use the `--help` option to display additional information about available options.

```
dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -c Release -- --help
dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.Jobs.csproj -c Release -- --help
```

Some notable options include the `--only` and `--skip` options. `--only` lets you specify the exact jobs to run.
`--skip` is the opposite and lets you specify the jobs to skip. If `--only` and `--skip` is specified for the same job,
`--skip` takes precedence.

Warning: There are currently some generator bugs associated with running multiple jobs in the same process. We recommend
that you use `--only` to ensure that only one job is executed per process. Running multiple processes in parallel is
fine.

### Generated Bindings Output

All generated binding will be output to the `Jobs.JOB_NAME.SourceProject` path defined in `generator.json`.
Expand Down
Comment thread
Exanite marked this conversation as resolved.
File renamed without changes.
2 changes: 1 addition & 1 deletion eng/silktouch/sdl/settings.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--define-macro
TODO_DEFINE_MACROS=HERE
--headerFile
header.txt
../header.txt
--include-directory
../../../submodules/sdl/include
../../../include/glcompat
Expand Down
Loading
Loading