mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
aux/tc: don't use pipe_buffer_create_with_data() for rp-optimized subdata
this function doesn't use the correct tc map flags, which causes drivers to (potentially) use the wrong slab for transfer allocation and then crash Fixes:51ad269198("aux/tc: handle stride mismatch during rp-optimized subdata") Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25227> (cherry picked from commita5be0385c7)
This commit is contained in:
parent
70dd0f0f79
commit
9a94bb19ed
2 changed files with 4 additions and 2 deletions
|
|
@ -1066,7 +1066,7 @@
|
|||
"description": "aux/tc: don't use pipe_buffer_create_with_data() for rp-optimized subdata",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "51ad269198e425fae719a37f169b365a8b52e7f3"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3166,7 +3166,9 @@ tc_texture_subdata(struct pipe_context *_pipe,
|
|||
format = PIPE_FORMAT_S8_UINT;
|
||||
unsigned fmt_stride = util_format_get_stride(format, box->width);
|
||||
unsigned fmt_layer_stride = util_format_get_2d_size(format, stride, box->height);
|
||||
struct pipe_resource *pres = pipe_buffer_create_with_data(pipe, 0, PIPE_USAGE_STREAM, layer_stride * box->depth, data);
|
||||
|
||||
struct pipe_resource *pres = pipe_buffer_create(pipe->screen, 0, PIPE_USAGE_STREAM, layer_stride * box->depth);
|
||||
pipe->buffer_subdata(pipe, pres, PIPE_MAP_WRITE | TC_TRANSFER_MAP_THREADED_UNSYNC, 0, layer_stride * box->depth, data);
|
||||
struct pipe_box src_box = *box;
|
||||
src_box.x = src_box.y = src_box.z = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue