Skip to content

gallium/u_threaded: Add buffer shadowing

Rob Clark requested to merge robclark/mesa:tc/resource-shadowing into main

For a tiler, for buffer uploads with DISCARD_RANGE, you want to create a clone of the original buffer in order to have both old and new versions of the buffer around, ie. draws prior to the update will reference the old version, and draws after the update will reference the new one. Whereas immediate mode renderers can simply upload new contents to the buffer from cmdstream between draws, tilers need the old contents because the first draw of 2nd tile exectutes after last draw of first tile.

To deal with this, introduce support for buffer "shadowing". The case is fairly similar to invalidation (DISCARD_WHOLE_RESOURCE), except the valid part of the non-discarded region is copied back and the valid- region is not cleared.

Merge request reports