Skip to content

asahi: Fix flushing

Asahi Lina requested to merge asahilina/mesa:agx/fix-flushing into main

As far as I can tell, flush() is actually supposed to do a full CPU-side sync if ASYNC or DEFERRED are not passed in. In that case we don't need to return a fence, since there is nothing left to wait on.

I'm not sure how much of a perf impact this might have on different workloads. If we decide that this is not necessary and we just want to go back to the behavior prior to the multiqueue patch, there is another option here: we store a device-global fence that is updated on flush, and have all future submissions (from any context) depend on it, creating a screen-global sync point. That should be equivalent as far as the GPU is concerned within a single screen, but it will not sync with the CPU nor across processes, so it is only correct if we conclude that is in fact not needed at all even with a full "non ASYNC" flush.

Fixes Blender black flashes after the multiqueue patch.

Edited by Asahi Lina

Merge request reports