TL;DR
The grid size here is supposed to be a power of two as explained in the codelab itself.
-------------------------
Details
From what I can tell, part of the reason why this does not produce the expected output grid-sizes other than 2^n
is due to the modulo (%
) operation involving the floating point.
Doing f32(my_u32) % my_f32
gives a different result from using two f32(my_u32%my_u32)
The conversion in the first code-line may yield the wrong number in certain cases, and the right number for powers of 2 only.