mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 23:40:33 +01:00
crocus/gen45: fix mapping compressed textures
I don't think iris ever hits this path, but probably has the same bug if it did. Fixes texsubimage on gfx4 + gfx4.5 Fixes:5bf6ec31cc("crocus/gen4: restrict memcpy mapping to gen5") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12164> (cherry picked from commitc12444ab88)
This commit is contained in:
parent
76a317170e
commit
5b99334ba3
2 changed files with 7 additions and 2 deletions
|
|
@ -22,7 +22,7 @@
|
|||
"description": "crocus/gen45: fix mapping compressed textures",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5bf6ec31ccf6c24a407df9443a534f8036d26861"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1542,12 +1542,17 @@ crocus_map_direct(struct crocus_transfer *map)
|
|||
const unsigned cpp = fmtl->bpb / 8;
|
||||
unsigned x0_el, y0_el;
|
||||
|
||||
assert(box->x % fmtl->bw == 0);
|
||||
assert(box->y % fmtl->bh == 0);
|
||||
get_image_offset_el(surf, xfer->level, box->z, &x0_el, &y0_el);
|
||||
|
||||
x0_el += box->x / fmtl->bw;
|
||||
y0_el += box->y / fmtl->bh;
|
||||
|
||||
xfer->stride = isl_surf_get_row_pitch_B(surf);
|
||||
xfer->layer_stride = isl_surf_get_array_pitch(surf);
|
||||
|
||||
map->ptr = ptr + (y0_el + box->y) * xfer->stride + (x0_el + box->x) * cpp;
|
||||
map->ptr = ptr + y0_el * xfer->stride + x0_el * cpp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue