aux/tc: fix staging buffer sizing for texture_subdata

this is the size of the src data, not the dst data

Fixes: 51ad269198 ("aux/tc: handle stride mismatch during rp-optimized subdata")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25180>
(cherry picked from commit b6bc1f85f4)
This commit is contained in:
Mike Blumenkrantz 2023-09-12 08:48:48 -04:00 committed by Eric Engestrom
parent 07d4d6e70c
commit 414f6b3af6
2 changed files with 2 additions and 2 deletions

View file

@ -2650,7 +2650,7 @@
"description": "aux/tc: fix staging buffer sizing for texture_subdata",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "51ad269198e425fae719a37f169b365a8b52e7f3"
},

View file

@ -3154,7 +3154,7 @@ 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, fmt_layer_stride * box->depth, data);
struct pipe_resource *pres = pipe_buffer_create_with_data(pipe, 0, PIPE_USAGE_STREAM, layer_stride * box->depth, data);
struct pipe_box src_box = *box;
src_box.x = src_box.y = src_box.z = 0;