mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 21:30:23 +01:00
gallium/tc: zero alloc transfers
Otherwise this causes trouble with unitialized memory, eg with:
struct si_transfer {
struct threaded_transfer b;
struct si_resource *staging;
};
'staging' will not be initialized and this causes #6109.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6109
Cc: mesa-stable
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15298>
(cherry picked from commit 3c3a8f853d)
This commit is contained in:
parent
eb7534abc8
commit
0bef7767b2
2 changed files with 2 additions and 4 deletions
|
|
@ -769,7 +769,7 @@
|
|||
"description": "gallium/tc: zero alloc transfers",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2148,11 +2148,9 @@ tc_buffer_map(struct pipe_context *_pipe,
|
|||
* only get resource_copy_region.
|
||||
*/
|
||||
if (usage & PIPE_MAP_DISCARD_RANGE) {
|
||||
struct threaded_transfer *ttrans = slab_alloc(&tc->pool_transfers);
|
||||
struct threaded_transfer *ttrans = slab_zalloc(&tc->pool_transfers);
|
||||
uint8_t *map;
|
||||
|
||||
ttrans->staging = NULL;
|
||||
|
||||
u_upload_alloc(tc->base.stream_uploader, 0,
|
||||
box->width + (box->x % tc->map_buffer_alignment),
|
||||
tc->map_buffer_alignment, &ttrans->b.offset,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue