summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-27 17:33:42 +0200
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commit7d88233f84cf9320ac6be232c2b20ad2d943bc51 (patch)
tree5cbc9198f1add6ca1d6b78d862ff2bd59d906fd1 /src/gallium/drivers
parentde55e57e29d3392bfc7a7cb31ddf883e382d8138 (diff)
radeonsi/gfx9: handle pitch and offset overrides for texture_from_handle
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index df260b64328..0231fe2068c 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -266,18 +266,25 @@ static int r600_init_surface(struct r600_common_screen *rscreen,
return r;
}
- if (pitch_in_bytes_override &&
- pitch_in_bytes_override != surface->u.legacy.level[0].nblk_x * bpe) {
- /* old ddx on evergreen over estimate alignment for 1d, only 1 level
- * for those
- */
- surface->u.legacy.level[0].nblk_x = pitch_in_bytes_override / bpe;
- surface->u.legacy.level[0].slice_size = pitch_in_bytes_override * surface->u.legacy.level[0].nblk_y;
- }
+ if (rscreen->chip_class >= GFX9) {
+ assert(!pitch_in_bytes_override ||
+ pitch_in_bytes_override == surface->u.gfx9.surf_pitch * bpe);
+ surface->u.gfx9.surf_offset = offset;
+ } else {
+ if (pitch_in_bytes_override &&
+ pitch_in_bytes_override != surface->u.legacy.level[0].nblk_x * bpe) {
+ /* old ddx on evergreen over estimate alignment for 1d, only 1 level
+ * for those
+ */
+ surface->u.legacy.level[0].nblk_x = pitch_in_bytes_override / bpe;
+ surface->u.legacy.level[0].slice_size = pitch_in_bytes_override *
+ surface->u.legacy.level[0].nblk_y;
+ }
- if (offset) {
- for (i = 0; i < ARRAY_SIZE(surface->u.legacy.level); ++i)
- surface->u.legacy.level[i].offset += offset;
+ if (offset) {
+ for (i = 0; i < ARRAY_SIZE(surface->u.legacy.level); ++i)
+ surface->u.legacy.level[i].offset += offset;
+ }
}
return 0;
}