The problem was that float3 (and other type3 types) behave as float4 (and other type4 types) for the purposes of size and alignment, as mentioned here:
http://stackoverflow.com/a/16647333So if I use float3 I have to specify the w component of the vector, like it was a 4 components vector.