How can i cast float* to float2*

hallo,

it is possible to cast a 16 byte aligned float* (float array) to a float2* (float2 array)

Thanks for Help

Yes, you can cast an array of two float to the vector type float2.

E.g; float2 bar= *(float2 *)foo;

but can i cast a array with n values of floats to an array with n/2 values of float2 ???

Can’t see any difference of that and above.

E.g. ((float2 *)floatptr)[idx]

THANK YOU VERY MUCH!

I forget the outside brace…therefore it won’t work…

Thanks

A.