From 414f6b3af69907641691f645cb7ced8d56c63299 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 12 Sep 2023 08:48:48 -0400 Subject: [PATCH] aux/tc: fix staging buffer sizing for texture_subdata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is the size of the src data, not the dst data Fixes: 51ad269198e ("aux/tc: handle stride mismatch during rp-optimized subdata") Acked-by: Marek Olšák Part-of: (cherry picked from commit b6bc1f85f45d1fea9e8a674dbfa1766b03ad5a9d) --- .pick_status.json | 2 +- src/gallium/auxiliary/util/u_threaded_context.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0a7e2387fc0..71def7ec37b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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" }, diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 3d4daf7729b..2a296895346 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -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;