asahi: Copy resources if needed to shadow
This lets us shadow textures updated in the middle of rendering in Quake3. They're big memcpys, but as long as the texture memory is cached it's ok. We use a heuristic to avoid too many memcpys from uncached memory, which would cause slideshow performance in quake.
We need to be careful to avoid shadowing shared resources, though, that's invalid and would break WSI pretty hard.
It would be better to blit on the GPU for large shadowing, but that's more involved and left for future work.
Reduces stuttering in Quake3.
Signed-off-by: Alyssa Rosenzweig alyssa@rosenzweig.io