Repository navigation
[3.0] Exanite's Tracking Issue #2586
Description
Exanite's Tracking Issue
This tracks a bunch of miscellaneous tasks that I accumulated while working on Silk 3.
I'm open for anyone to work on these tasks, but please discuss with me in the Silk Discord first.
A task being here on this tracker does not mean it is guaranteed to be completed.
This tracker's primary goal is so that we do not accidentally forget about tasks and that any tasks not completed are intentionally left uncompleted.
In-progress
Tasks in progress will be moved to the corresponding pull request.
Uncategorized
This section contains informal reports, suggestions, or complaints about Silk 3.
I'm logging them here so they don't get forgotten about until I either open a formal issue or address them.
From Aqua:
- Silk 3 does not prefer its own native binaries? I.e., it prefers the system ones instead of the ones shipped by Silk.
- Go through the thread Aqua has made: https://discord.com/channels/521092042781229087/1512914692853465088
From Ethereal:
- SilkTouch generator takes an immense amount of RAM: https://discord.com/channels/521092042781229087/607634593201520651/1513592461493145601
- I need to also check with Curin to see how much RAM their device has. If their device doesn't have enough RAM, this might explain why the Microsoft job takes so long (aside from it already processing a lot of data).
- Run the Microsoft job locally and see how much RAM it takes on my device.
From Curin:
- For D3D12, the Agility SDK is loaded from the System32 DLL instead of the working directory's D3D12 subdirectory. This means that Silk 2.x (report was for 2.x) and maybe Silk 3.0 (needs verification) cannot access Agility SDK features. See https://discord.com/channels/521092042781229087/587346162802229298/1549273531668373566
- My comment: seems to be another search path issue. This seems similar to my issue in Silk 2 where system binaries are preferred over the vendored/local ones. I'm personally very interested in changing Silk so that it always prefers local binaries whenever possible.
From me (Exanite):
- OpenCL
GetPlatformIDs,GetDeviceIDs, and likely more functions do not have singularGetPlatformIDequivalents. This should be handled by our function transformer so I'm guessing the XML metadata is missing. See [3.0] Add OpenCL and OpenXR bindings #2590 (comment). - Test projects should be added for all bindings. See [3.0] Add OpenCL and OpenXR bindings #2590 (comment)
- InlineArray structs should have implicit casts from strings/arrays, i.e., should behave like Ref. See [3.0] Add OpenCL and OpenXR bindings #2590 (comment)
- API object devirtualization:
- See Perksey's comment and my comment here on potentially returning the concrete API class instead of the instance: [3.0] Add OpenCL and OpenXR bindings #2590 (comment)
- These comments were in response to my todo comments in the OpenCL example program
- Also see Perksey's idea to change the return something like
GL<T>whereTis anINativeContextto remove one level ofcallvirt: https://discord.com/channels/521092042781229087/587346162802229298/1541090497185980478
- See Perksey's comment and my comment here on potentially returning the concrete API class instead of the instance: [3.0] Add OpenCL and OpenXR bindings #2590 (comment)
- Add option to sort enum members during TransformEnums
From me (Exanite), as part of my OpenCL example program:
Original comments:
Silk.NET/examples/CSharp/OpenCL/Tutorial001.SimpleKernel/Program.cs
Lines 75 to 80 in 021738d
| // Load API | |
| // TODO: These todos apply to all Silk bindings. | |
| // TODO: Consider making INativeContext public. It's nice for debugging. | |
| // TODO: Consider returning the concrete class instead of the interface. Having to cast to access Cl.CurrentPlatform is annoying. | |
| // TODO: I liked how INativeContext only required the function name in Silk 2. Silk 3 is currently `LoadFunction(functionName, libraryNameHint)`. | |
| var cl = Cl.Create(); // TODO: This should be disposable |
- Expose INativeContext from the concrete API object where applicable (but not the interface)
- Discuss INativeContext API. Silk 3 is currently
LoadFunction(functionName, libraryNameHint), but I liked how Silk 2 only required the function name.
From me (Exanite), as part of the code review during #2624:
- Open a follow up PR that removes Autofac. We discussed this and while MS DI isn't the best DI solution feature-wise, I think we can avoid adding another dependency without much downside.
- Add dedicated documentation section/folder for using the SilkTouch generator as a non-contributor.
- Add single file SilkTouch example project
- Add SilkTouch example project that implements a custom mod
- If possible, change the public API docs analyzer to also require API docs on internal APIs
- This is to ensure that we keep our internal docs up to par even after we make everything internal instead of public.
Bindings and feature requests
From Nolram (https://discord.com/channels/521092042781229087/607634593201520651/1524213012402147348):
- Add Imgui bindings
- Nolram recommended https://github.com/dearimgui/dear_bindings over cimgui (https://github.com/cimgui/cimgui)
- Investigate whether direct P/Invoke and static linking works in Silk 3 and how we want to support it.
- From what I can tell, it involves some configuration, providing static builds,
and maybe switching over to LibraryImport over DllImport.
- From what I can tell, it involves some configuration, providing static builds,
From dfkeenan:
- Add SDL shadercross support: https://discord.com/channels/521092042781229087/587346162802229298/1543100984270520340
- My opinion on this: Shadercross is worth doing, worth considering the rest of the SDL addons as well, since Silk 3 leans much more heavily on SDL.
High priority
Bindings usage:
- Add option to configure which vendor suffixes
KhronosNonExclusiveVendorcan identify. Eg: For OpenGL, this should be onlyARB.- See conversation here: https://discord.com/channels/521092042781229087/587346162802229298/1531416150565453924
Documentation:
- Add Vulkan example project
- Add bindings usage docs
- Explain that the native docs for each API can be used since Silk doesn't really change how you use the API
- Explain difference between bindings and high level APIs
- Ie, high level APIs do not represent bindings so usually the native docs don't apply for those
- Explain the different DSL types and magical constants (eg:
nullptr)
Medium priority
SilkTouch generator API:
This will probably be implemented
- Abstract out DI container from the public API so we aren't locked into a specific framework. See discussion here: https://discord.com/channels/521092042781229087/587346162802229298/1561387300443791481
- Alternative discussed: Just switch back to MS DI. Should be possible with some trade offs.
- Lock down public API to only the types necessary to integrate and add custom SilkTouch mods.
- Add example project of implementing a custom SilkTouch mod with only public APIs available.
ABI compat proposal:
- Verify that we can create and modify a ref assembly to hide the Silk 2 to Silk 3 remappings. This is important for IDE performance since otherwise IDEs will still perform slow in Silk 3. See https://discord.com/channels/521092042781229087/1560213833249726474/1561333409127604256
Native binaries:
- (From Aqua) libSDL3.so is humongous (should not be nearly 14 MB)
- Exanite: I checked my system version and that one is only 3 MB.
- Edit - Exanite: Looks like running
file libSDL3.sosayslibSDL3.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped, so definitely because the binary was not stripped
Bindings:
- Use
CLongwhere possible in the bindings.- For enums, use
Constant<CLong, EnumHere>, and theoretically it should work. - See conversation here: [3.0] Add OpenCL and OpenXR bindings #2590 (comment)
- For enums, use
- Consider implementing a
IsProbablyABitmaskfunction based on BuildTool's IsProbablyABitmask for identifying flags enums
Maintenance:
- ClangSharp switched from System.CommandLine to a custom command line argument parser. I noticed that we had verbatim copied code from ClangSharp for handling arguments in Silk 3, so we should update that.
- This also lets us update System.CommandLine, which we are still using a beta version of.
Low priority
Maintenance:
- Cross reference changelog and past issues for Silk 2 to ensure that we don't have the same bugs in Silk 3
High level utilities:
- Reimplement the Vulkan struct chaining API
- Add image format utils for Vulkan/etc
IDE / Metadata:
- Ensure SupportedApiProfiles attributes are correct
- Properly resolve API profiles for Flags/FlagBits types
- Prefer name from
NativeNamefor resolving API profiles
- Consider optimizing
NativeNameattributes.- This should involve renaming
StripAttributestoCleanupAttributesand adding an option in its config to optimizeNativeNameattributes. - Also see: [3.0] Implement name-related improvements identified in previous Vulkan PR #2503 (comment)
- This should involve renaming
Completed tasks and canceled tasks
Completed
After maintaining this section for a bit, I'll only list tasks not obviously related to a PR. Otherwise, it means that I'm tracking the same task in two places, which can get confusing.
Completed during #2588:
- Switch to SLNX solution format to improve readability/mergability
- From Ethereal: They had a CSharpier TypeLoadException when running the Win32 job on
develop/3.0. Might be related to the error I saw half a year ago. If so, likely can be fixed by simply updating CSharpier. CSharpier has updated their Roslyn package since then.
Completed during #2591:
- Port back the
--onlyoption from Curin's branch so I don't need to specify--skipfor all but one job
Completed or planned to be completed during #2590 (not yet merged):
- Begin work on the rest of the Khronos bindings
- I'd like to start this early because this lets us spot issues early and we can use these as test cases for the rest of the changes.
- Generator usage: Explain SilkTouch CLI options
- Generator usage: Clarify that SilkTouch does not modify non
.gen.cs.csfiles during theGenerated Bindings Outputsection - Consider reworking data type trimming regexes.
- This was discussed more here: [3.0] Implement name-related improvements identified in previous Vulkan PR #2503 (comment)
- The summary is that the current set of 2 regexes doesn't elegantly handle the case where the ending of a word should not be trimmed, but the word itself can have data type suffixes.
- For example:
alSourceRewindvandalSourceRewind. ThedinRewindcan be mistaken as a data type suffix, so we add it to theEndingsNotToTrimregex. However, thedvinRewindvalso has the same problem. - We likely need something more akin to
WordsNotToTrimIntothanEndingsNotToTrim.
- Investigate why we currently use DllImport in Silk 3.
- Also added some light documentation to
AddVTablesin the mod MD docs.
- Also added some light documentation to
Completed in dotnet/ClangSharp#699
- Consider opening a ClangSharp PR to fix issue with
SDL_MAX_SINT64generation on Linux- More context: https://discord.com/channels/521092042781229087/1376331581198827520/1443401810822828113
public const nint SDL_MAX_SINT64 = unchecked(0x7FFFFFFFFFFFFFFF);does not compile
Completed outside of a PR:
- For
DrawElements/etc, check if the pointer to 0 issue present in Silk 2 still exists in Silk 3 - Investigate using the new BitCast optimizations: https://discord.com/channels/143867839282020352/312132327348240384/1517589517727436952
- Eg: BitCasting a user struct to a Vector struct and immediately using an SIMD operation is now properly optimized. Free performance!
- This mainly affects Otac0n's work, but I'm logging it here so I also keep it in mind as I work on the bindings.
- Decision: Just going to keep this in mind. Don't think I need to actively review the bindings for this since there's not many places where this will be used.
Not doing
For transparency and for reference, I'll move any tasks I don't plan on doing here.
Figure out how to handle CLA properly. Currently native builds will block CLA due to the use of a bot account.- Seems to be fine now.
Differentiate between smoke tests and actual tutorials/examples. I would categorize the current SDL/OpenAL "tutorials" in Silk 3 to be smoke tests since they really shouldn't be referenced as sources of best practices.- This was discussed during the OpenCL/XR PR: [3.0] Add OpenCL and OpenXR bindings #2590 (comment)
Quality (probably will add this section back later):
- [/] Add some way of verifying our bindings are well polished.
- These would mainly involve simple automated sanity checks that ensure our bindings our consistent. Could be done as a separate CLI project from SilkTouch.
- [/] Check for missing namespaces.
- This was an issue discovered during [3.0] Split up ExtractNestedTyping and add tests for TransformHandles #2587. I've fixed one case of these, but haven't verified the rest of the generated files (since there's way too many to manually verify).
- [/] Check for spelling/casing issues? Identifiers like
Sdl.PropGpuDeviceCreateDebugmodeBooleanare technically correct (native name isSDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN, soDebugmodeis "one" word), but we could have an audit tool that checks for these non-ideal cases so we can add manual overrides. Worth the effort? Probably not unless we care about perfecting the bindings.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Progress
Activity
Exanite commentedon Jun 17, 2026
PR Plan
Khronos vendor suffixesDetails
Reconsider the usage of KhronosImpliedVendor suffixesAlso tempted to remove KhronosNonExclusiveVendors since I find this behavior to be more incorrect than it is helpful. It also lets me delete a lot of code (yay!).Khronos bindings improvements
clGetExtensionFunctionAddressForPlatformlimits our OpenCL bindings to OpenCL v1.2.XrPerfSettingsNotificationLevelEXTneeds a prefix override for proper shared prefix identification. I know the type name affects it, but I thought that was a fallback case.XrStructureTypeandXrSceneMarkerQRCodeSymbolTypeMSFT1St,2NdRemaining bindings I plan to work on
MoltenVK would just be a native build. VMA is not on the tracking issue, but we already discussed that we want this to be in Silk 3 (and I want it for my personal projects as well).
develop/3.0Bindings polish (may be split into multiple PRs)
ExtractEnumConstantsdoes not preserve attributes placed on extracted constants (needs verification).nullptr. Seems like a nice QOL feature.InlineArrayN<T>types provided by .NET? Should we use them?channels/521092042781229087/1514735149915439274/1519099432442794150
nullptrconstant does not work. It fails to resolve to anything.RegisterHookin both Vk (defined in a manual file) and Vk.DllImport (defined in a generated file).Enums and other integral typedefs:
<auto-generated/>comment to start of each generated file. This has the effect of disabling IDE/linter/etc checks, which means less noise and performance cost of working in the Silk repo.These have been proving to be consistently annoying to work with...
Vulkan and OpenXR have some special handling so this problem is less problematic, but still exists.
void DrawElements(uint mode, uint count, uint type, void* indices);uint.uintis used instead ofMaybeBool<uint>.Cleanup todos in OpenCL example program
[3.0] Add OpenCL and OpenXR bindings (#2590)