PDA

View Full Version : Micro Optimization with matrices



robobo1221
08-24-2016, 06:29 AM
Hello.

I've just read that you can micro optimize with vectors. They say swizzeling is free and a vector costs as much as a floating point number.
So, my question is, does this count to matrices? Like, does one matrix costs as much as a floating point number and you can swizzle for free?

I realy want to know this because, i realy want to optimize the things i already have.

Thanks already!

Spoops
08-24-2016, 02:43 PM
Depends on the implementation but more often than not, a matrix is actually N times a vector (N being the number of rows). Matrix multiplication is thus N times a dot product.