It would be really nice if you could . . .

Discussion created by Photovore on Nov 19, 2011
Latest reply on Nov 20, 2011 by Meteorhead
. . . use an int4 as a subscript to a float4, and have it work element-wise....

It does seem that it's not possible, but:

I have a float4 calculation, which I must break down into subelements and process individually, s0->s3, because I'm using an array in the calc and the subscripts for the array differ between the float4 elements.

I kinda knew it wasn't possible, but I did attempt anyway,  to perform the whole calc as a single float4 using an int4 as the subscript to a float4 variable (hoping that the float4.s0 calc would use the int4.s0, the float4.s1 would use the int4.s1, et cetera.)  When I tried it, of course, I got an error message complaining that the array subscript was not an int.

Does anyone else think this would be a good idea to be able to do? Any general ideas as to what to try, from someone who's been here before?  It's not critical; my app works; I'd just like to Squeeze a leeeetle bit more performance out of it....