Skip to content

gallium/u_threaded: fix multicontext busy tracking

This was originally suggested by https://gitlab.freedesktop.org/pepp while troubleshooting bug #5327 (comment 1422280)

This commit implements a slightly different variant of that patch. It considers all buffers to be busy if multiple contexts are present.

This is required since it is also necessary to prevent upgrades to PIPE_MAP_UNSYCHRONIZED when mapping / uploading to a buffer. An inadvertent upgrade to PIPE_MAP_UNSYNCHRONIZED might cause a buffer to be overwritten while another context is still using it for a draw call.

At the same time, this patch doesn't prevent buffer invalidations to proceed via the reallocation path, thereby avoiding unnecessary synchronization. Reallocations don't interfere with previously submitted draw calls, so this is safe.

Merge request reports