diff options
author | Marek Olšák <[email protected]> | 2018-01-10 13:37:08 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2018-01-26 19:53:00 +0000 |
commit | 48510dccc4dffa09c5533b06f6e7ed578d075bde (patch) | |
tree | 49eed05e6015ac64f9cee3a52126998c3647c3a8 | |
parent | f6f43e6a4c13b0b8d8425dd9a62306a0d0f5a2f5 (diff) |
radeonsi: don't ignore pitch for imported textures
Cc: 17.2 17.3 <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
(cherry picked from commit 022c5b22fee5d92da67f48601ea80b1c810a829d)
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 34b3ab0cdeb..36eff40949f 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -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; |