Skip to content

WIP: virgl: Wait for resources to be released before mapping them

Alexandros Frantzis requested to merge afrantzis/mesa:virgl-buffer-sync into master

Resources may be in use by the host when mapping and writing to them. We need to wait for any mapped resources to be released at map time.

Example problematic scenario:

  1. map, write A to uniform buffer U, unmap
  2. draw 1
  3. map, write B to uniform buffer U, unmap
  4. draw 2

Since writing to mapped resources is done out of band (relative to command buffer execution on the host), we could write B to the uniform buffer before executing draw 1, if we are not waiting for the uniform buffer to be released before writing B.

Showcase: https://github.com/glmark2/glmark2/tree/ubo run with 'glmark2 -b ubo' Before: Occasional flicker in colored rectangles After: No flicker

TODO: Be smarter about avoiding waiting when not required, could use fences to signal resource acquisition and release.

Signed-off-by: Alexandros Frantzis alexandros.frantzis@collabora.com

Merge request reports