mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 07:58:07 +02:00
aux/tc: fix address calc for segmented texture subdata
this fixes all dimension/array uses for the rp tracking path 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 commit5f73b8976b)
This commit is contained in:
parent
4d7b7927ff
commit
3c20252635
2 changed files with 6 additions and 12 deletions
|
|
@ -3974,7 +3974,7 @@
|
|||
"description": "aux/tc: fix address calc for segmented texture subdata",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "51ad269198e425fae719a37f169b365a8b52e7f3",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -3167,10 +3167,9 @@ tc_texture_subdata(struct pipe_context *_pipe,
|
|||
tc->base.resource_copy_region(&tc->base, resource, level, box->x, box->y, box->z, pres, 0, &src_box);
|
||||
} else {
|
||||
/* if stride doesn't match, inline util_copy_box on the GPU and assume the driver will optimize */
|
||||
unsigned src_offset = 0;
|
||||
src_box.depth = 1;
|
||||
for (unsigned z = 0; z < box->depth; ++z) {
|
||||
unsigned dst_x = box->x, dst_y = box->y, width = box->width, height = box->height;
|
||||
for (unsigned z = 0; z < box->depth; ++z, src_box.x = z * layer_stride) {
|
||||
unsigned dst_x = box->x, dst_y = box->y, width = box->width, height = box->height, dst_z = box->z + z;
|
||||
int blocksize = util_format_get_blocksize(format);
|
||||
int blockwidth = util_format_get_blockwidth(format);
|
||||
int blockheight = util_format_get_blockheight(format);
|
||||
|
|
@ -3190,20 +3189,15 @@ tc_texture_subdata(struct pipe_context *_pipe,
|
|||
uint64_t size = (uint64_t)height * width;
|
||||
|
||||
assert(size <= SIZE_MAX);
|
||||
src_box.x = src_offset;
|
||||
assert(dst_x + src_box.width < u_minify(pres->width0, level));
|
||||
assert(dst_y + src_box.height < u_minify(pres->height0, level));
|
||||
assert(pres->target != PIPE_TEXTURE_3D || z + src_box.depth < u_minify(pres->depth0, level));
|
||||
tc->base.resource_copy_region(&tc->base, resource, level, dst_x, dst_y, z, pres, 0, &src_box);
|
||||
tc->base.resource_copy_region(&tc->base, resource, level, dst_x, dst_y, dst_z, pres, 0, &src_box);
|
||||
} else {
|
||||
src_box.height = 1;
|
||||
for (unsigned i = 0; i < height; i++, dst_y++) {
|
||||
src_box.x = src_offset;
|
||||
tc->base.resource_copy_region(&tc->base, resource, level, dst_x, dst_y, z, pres, 0, &src_box);
|
||||
src_offset += stride;
|
||||
}
|
||||
for (unsigned i = 0; i < height; i++, dst_y++, src_box.x += stride)
|
||||
tc->base.resource_copy_region(&tc->base, resource, level, dst_x, dst_y, dst_z, pres, 0, &src_box);
|
||||
}
|
||||
src_offset += layer_stride;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue