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.75k stars 123 forks source link

Remove VectorN/Math/MatF HLSL projections #711

Closed Sergio0694 closed 10 months ago

Sergio0694 commented 10 months ago

Description

This PR removes support for using Vector2, Vector3, Vector4, Math and MathF APIs in shaders. This was error prone and not really well supported anyway (lots of methods were still not usable from shaders). So with this, using HLSL primitives and APIs is actually required, which makes the shader code much more explicit and easier to understand, and with better separation.

rickbrew commented 10 months ago

I would recommend you to keep the Math/MathF detection for one release, not to support calling the methods, but to raise an error to guide the user in the right direction. "Don't use Math/MathF, use Hlsl instead." Some devs will be legitimately lost without this, and it will just seem like it's a bug in ComputeSharp. It's the polite thing to do ...