amerkoleci / Vortice.Windows

.NET bindings for Direct3D12, Direct3D11, WIC, Direct2D1, XInput, XAudio, X3DAudio, DXC, Direct3D9 and DirectInput.
MIT License
1.01k stars 73 forks source link

Add trimming annotations #408

Closed dmirmilshteyn closed 1 year ago

dmirmilshteyn commented 1 year ago

This adds DynamicallyAccessedMembers annotations to most required areas, and fixes the vast majority of warnings caused by their absence. This should improve compatibility with more aggressive trimming modes in .NET 8.

In my case specifically, I'm seeing constructors trimmed out despite the annotations being present on the underlying Marshal helpers from SharpGenTools. With these annotations in place, trimming works successfully.

Please let me know if any changes need to be made; I'd like to see this merged in sooner rather than later. Thank you!

amerkoleci commented 1 year ago

Thanks!