Original Post
I'm using the isinf(x) function in a pixel shader to trap some calculation I'm doing spiralling to infinity. My code looks something like this...
float4 my_vector;
// Calculations on my_vector in here...
if (isinf(my_vector))
// Do something here...
I get a compilation error saying "float expected". However the DirectX documentation for isinf(x) suggests "x" can be a scalar, vector or matrix. What have I done wrong here? Incidentally, what I am assuming from trying to make this call is that isinf will return TRUE if any of the components of my_vector are +/- infinity. Is that correct? I have tried the following... if ((isinf(my_vector.x) + isinf(my_vector.y) + isinf(my_vector.z) + isinf(my_vector.a)) > 0) and it's worked fine, but I assumed if I could use isinf(my_vector), that it would be faster.