zink: force streamout rebind when mapping a streamout buffer for writing

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>
This commit is contained in:
Mike Blumenkrantz 2021-05-19 12:39:48 -04:00
parent a29688a0d1
commit 517484ea89

View file

@ -943,6 +943,12 @@ buffer_transfer_map(struct zink_context *ctx, struct zink_resource *res, unsigne
}
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;