bit-hack / tack

Tack - The vector wrapper
0 stars 0 forks source link

Add support for vector scalar operations. #19

Open kbenzie opened 8 years ago

kbenzie commented 8 years ago

A common use case is to operator on vector with a scalar value, for example float4(3.f, 2.f, 1.f, 0.f) * 0.5f.

We should add support for these operators.

bit-hack commented 8 years ago

We definitely do need this, however, I think this can only come once we have implemented the float1 class, since we don’t want to be loading a float4 from the FPU for this operation. To keep this fast we will need to use the lower lane of the SSE registers via the float1 class. I'm definitely not opposed to knocking up a small float1 implementation, to get a better sense of how these two classes might interact and what that might meen for our interface.