Skip to content
Snippets Groups Projects
Commit febfe471 authored by Mike Blumenkrantz's avatar Mike Blumenkrantz :lifter: Committed by Dylan Baker
Browse files

zink: handle device-local unsynchronized maps


this is only possible when tc determines the buffer is not in use
and decides to return a pointer immediately, so just give back a staging
buffer

cc: mesa-stable

Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Part-of: <mesa/mesa!15979>
(cherry picked from commit d7256043)
parent e3f21dbc
No related branches found
No related tags found
No related merge requests found
......@@ -340,7 +340,7 @@
"description": "zink: handle device-local unsynchronized maps",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"because_sha": null
},
{
......
......@@ -1490,6 +1490,15 @@ zink_buffer_map(struct pipe_context *pctx,
ptr = map_resource(screen, res);
ptr = ((uint8_t *)ptr) + trans->offset;
}
} else if ((usage & PIPE_MAP_UNSYNCHRONIZED) && !res->obj->host_visible) {
trans->offset = box->x % screen->info.props.limits.minMemoryMapAlignment;
trans->staging_res = pipe_buffer_create(&screen->base, PIPE_BIND_LINEAR, PIPE_USAGE_STAGING, box->width + trans->offset);
if (!trans->staging_res)
goto fail;
struct zink_resource *staging_res = zink_resource(trans->staging_res);
res = staging_res;
ptr = map_resource(screen, res);
ptr = ((uint8_t *)ptr) + trans->offset;
}
if (!(usage & PIPE_MAP_UNSYNCHRONIZED)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment