This happened in the following render test: `render/light/all_light_types_in_volume.blend` Unfortunately it seems non-deterministic. To fix this, we change the heuristic to jump out of the shadow update loop. Also introduce a upper bound to the number of iteration. On top of this, add a flush for every loop to avoid huge command buffer submission. Thanks @pragma37 for the fix.