We call viewport.get_texture() to pull the viewport texture.
if I turn off the GPU then everything works perfectly and we get a well defined ordering.
With the GPU we can get an undefined result and can be off by one cycle. This I think must be due to how the GPU delivers the texture and some locking steps that occur.
I only see the problem for web export so far in my testing.
Is there a safe place in the Godot cycle to access the Gpu texture so it will be a well defined result? I've seen some old posts using yield but didn't have any luck yet solving the issue yet.