Tempted to switch to https://github.com/shader-slang/slang for compute shader language. It has some very nice features but I'm a bit worried that I might hit some limits with no workaround (for instance, it doesn't look like they support pointers into groupshared memory)

Anyone has experience with it? Thoughts?

GitHub - shader-slang/slang: Making it easier to work with shaders

Making it easier to work with shaders. Contribute to shader-slang/slang development by creating an account on GitHub.

GitHub

Thinking about it, I'm even more tempted to prototype a C# source generator that would create SPIR-V (compute shader) code directly from C#. There are some challenges with supporting generics but it seems doable thanks to the nice extension mechanism in SPIR-V

C# code would be easier to support than IL, as it maps more naturally to SPIR-V CFG.

More generally expressing Tensor/ML workloads straight from C# would be so cool 😎

Ok, I think I have found my next pet project for April 😅

#dotnet

@xoofx a c# to compute shader compiler already exists if you are interested I can link it

@sebify yeah, I have seen some of them around https://github.com/m4rs-mt/ILGPU/ and https://github.com/Alan-Rock-GS/GpuScript

Do you have others?

GitHub - m4rs-mt/ILGPU: ILGPU JIT Compiler for high-performance .Net GPU programs

ILGPU JIT Compiler for high-performance .Net GPU programs - m4rs-mt/ILGPU

GitHub
@xoofx computesharp is the one I actually used and worked like a breeze https://github.com/Sergio0694/ComputeSharp
GitHub - 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! 🚀

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 dev...

GitHub
@sebify oh yeah, I know that one. It is closer to how I would do it - with Roslyn Source Generators.