if the contents of the buffer change between uses, trigger the rebind path
next time a draw happens for synchronization
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10882>
}
if (!ptr) {
+ /* if writing to a streamout buffer, ensure synchronization next time it's used */
+ if (usage & PIPE_MAP_WRITE && res->bind_history & ZINK_RESOURCE_USAGE_STREAMOUT) {
+ ctx->dirty_so_targets = true;
+ /* force counter buffer reset */
+ res->bind_history &= ~ZINK_RESOURCE_USAGE_STREAMOUT;
+ }
ptr = map_resource(screen, res);
if (!ptr)
return NULL;