Sergio0694 / ComputeSharp

A .NET library to run C# code in parallel on the GPU through DX12, D2D1, and dynamically generated HLSL compute and pixel shaders, with the goal of making GPU computing easy to use for all .NET developers! 🚀
MIT License
2.74k stars 122 forks source link

Update ComputeSharp.D2D1.WinUI to AOT-safe CsWinRT #763

Closed Sergio0694 closed 3 months ago

Sergio0694 commented 8 months ago

Description

This PR updates ComputeSharp.D2D1.WinUI to make the code completely AOT-safe, by leveraging the new API changes in CsWinRT to properly support NativeAOT. Some minor changes were needed around how projection vtables were computed, as well as (thankfully) around how the activation factory for a given WinRT type can be retrieved and cast to some interop interface.