Is there intrinsic function or best-performance to rotate a vec2?

is there intrinsic function or best-performance to rotate a vec2?

vec2 v;
mat2 rotz = mat2(cos(theta), -sin(theta), sin(theta), cos(theta));
v = rotz * v;

unfortunately there isn’t any built in function. However IGPU’s/GPU’s are specialized for matrix and vector multiplication so there really shouldn’t be any issues for most applications.

1 Like