mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
radeonsi: don't ignore pitch for imported textures
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
0b8d38bd48
commit
022c5b22fe
1 changed files with 12 additions and 2 deletions
|
|
@ -298,11 +298,21 @@ static int r600_init_surface(struct si_screen *sscreen,
|
|||
return r;
|
||||
}
|
||||
|
||||
unsigned pitch = pitch_in_bytes_override / bpe;
|
||||
|
||||
if (sscreen->info.chip_class >= GFX9) {
|
||||
assert(!pitch_in_bytes_override ||
|
||||
pitch_in_bytes_override == surface->u.gfx9.surf_pitch * bpe);
|
||||
if (pitch) {
|
||||
surface->u.gfx9.surf_pitch = pitch;
|
||||
surface->u.gfx9.surf_slice_size =
|
||||
(uint64_t)pitch * surface->u.gfx9.surf_height * bpe;
|
||||
}
|
||||
surface->u.gfx9.surf_offset = offset;
|
||||
} else {
|
||||
if (pitch) {
|
||||
surface->u.legacy.level[0].nblk_x = pitch;
|
||||
surface->u.legacy.level[0].slice_size_dw =
|
||||
((uint64_t)pitch * surface->u.legacy.level[0].nblk_y * bpe) / 4;
|
||||
}
|
||||
if (offset) {
|
||||
for (i = 0; i < ARRAY_SIZE(surface->u.legacy.level); ++i)
|
||||
surface->u.legacy.level[i].offset += offset;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue