3 ms·
We have them.... for SIMD vectors.
by anonymoushn 3y ago
We have them.... for SIMD vectors.
- pixelpoet 3y agoThis forces us to use homogeneous 4D vectors for 3D ops ({vec3, 0} for directions and {vec3, 1} for points), which basically wastes registers when we're doing the right thing with the right vec3 types on a e.g. 32-wide vector machine. If Zig really wanted to do the best job here, it should recognise that we're semantically not using this 4th padding dimension if we're not doing 4D projective stuff. If it really is going to force you up to 4D space, then it should be doing compile time checks e.g. sorry, you tried to add point plus a point which makes no sense, unlike vectors, or vectors and points. This might become more important if Zig to GPU code translation becomes a thing...
- anonymoushn 3y agoRight, clearly SIMD vector primitive ops are not what you want for a 3d math lib.