glsl: Don't increase the iteration count when there are no terminators

Incrementing the iteration count was intended to fix an off-by-one error
when the first terminator was superseded by a later terminator.  If
there is no first terminator or later terminator, there is no off-by-one
error.  Incrementing the loop count creates one.  This can be seen in
loops like:

    do {
        if (something) {
            // No breaks or continues here.
    } while (false);

Reviewed-by: Timothy Arceri <>
Tested-by: Abel Briggs <>
Fixes: 646621c6 ("glsl: make loop unrolling more like the nir unrolling path")
10 jobs for !1152 with review/bug-110953 in 8 minutes and 52 seconds (queued for 2 seconds)
latest merge request