mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 16:50:10 +01:00
zink: stop allocating such massive staging regions for buffer maps
this would allocate a new stream uploader for every map if the offset was large (e.g., all sparse buffer usage), which almost immediately consumes all vram cc: mesa-stable fixes KHR-GL46.CommonBugs.CommonBug_SparseBuffersWithCopyOps Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14381>
This commit is contained in:
parent
7753ca2a45
commit
d83b52928c
1 changed files with 3 additions and 3 deletions
|
|
@ -1320,13 +1320,13 @@ zink_buffer_map(struct pipe_context *pctx,
|
|||
mgr = ctx->tc->base.stream_uploader;
|
||||
else
|
||||
mgr = ctx->base.stream_uploader;
|
||||
u_upload_alloc(mgr, 0, box->width + box->x,
|
||||
u_upload_alloc(mgr, 0, box->width,
|
||||
screen->info.props.limits.minMemoryMapAlignment, &offset,
|
||||
(struct pipe_resource **)&trans->staging_res, (void **)&ptr);
|
||||
res = zink_resource(trans->staging_res);
|
||||
trans->offset = offset + box->x;
|
||||
trans->offset = offset;
|
||||
usage |= PIPE_MAP_UNSYNCHRONIZED;
|
||||
ptr = ((uint8_t *)ptr) + box->x;
|
||||
ptr = ((uint8_t *)ptr);
|
||||
} else {
|
||||
/* At this point, the buffer is always idle (we checked it above). */
|
||||
usage |= PIPE_MAP_UNSYNCHRONIZED;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue