|Project:||The Open Toolkit library|
I just noticed the forum post regarding Mono.SIMD, and I would like to help bridge the current math structs with the SIMD structs where applicable (which appears to only be with Vector4 and Vector2d, unless we use Mono.SIMD.Vector4f for everything but with different components forced to be 0).
There are many ways to go about this, here are a few I can think of right now:
-Use a union struct in Vector4 where both X and the underlying Mono.SIMD.Vector4f starts at position 0. Methods/operator overloads would chain off to the corresponding SIMD methods/operators of the contained Vector4f. This would get messy fast.
-Introduce a new type of Vector4 using SIMD, have implicit casts on both types, let the user decide which one to use.
-Accept Mono.SIMD.Vector4f in all the GL methods that you accept Vector4 in. Let the user deal with everything else, maybe add a new constructor and explicit cast in Vector4 to help ease.
-Add methods like AddSIMD() for all the SIMD-supported operations and cast the vectors to the SIMD ones internally.
Any ideas? I'd really like to see this happen, OpenTK is an excellent library and having fast math operations can work as a selling point to use C#/OpenTK over other languages and OpenGL bindings/math libraries.