diff options
author | Chia-I Wu <[email protected]> | 2013-12-26 11:46:25 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-01-08 18:11:35 +0800 |
commit | 846f70a6ef8be5297eb6f4cf9cf8dc36ce22b818 (patch) | |
tree | 27d0bb62cfc54415cc43b179b98e00e8e3474bb6 /src/gallium/drivers/ilo/ilo_transfer.c | |
parent | 127fbc086ba9365e9304843af09fe730edb1d389 (diff) |
ilo: rename and add an accessor for texture slices
Rename ilo_texture::slice_offsets to ilo_texture::slices and add an accessor,
ilo_texture_get_slice().
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_transfer.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_transfer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/ilo/ilo_transfer.c b/src/gallium/drivers/ilo/ilo_transfer.c index 7d87537e99f..4bd688d5c73 100644 --- a/src/gallium/drivers/ilo/ilo_transfer.c +++ b/src/gallium/drivers/ilo/ilo_transfer.c @@ -186,10 +186,12 @@ tex_get_box_origin(const struct ilo_texture *tex, const struct pipe_box *box, unsigned *mem_x, unsigned *mem_y) { + const struct ilo_texture_slice *s = + ilo_texture_get_slice(tex, level, slice + box->z); unsigned x, y; - x = tex->slice_offsets[level][slice + box->z].x + box->x; - y = tex->slice_offsets[level][slice + box->z].y + box->y; + x = s->x + box->x; + y = s->y + box->y; assert(x % tex->block_width == 0 && y % tex->block_height == 0); @@ -211,6 +213,7 @@ tex_get_box_offset(const struct ilo_texture *tex, unsigned level, static unsigned tex_get_slice_stride(const struct ilo_texture *tex, unsigned level) { + const struct ilo_texture_slice *s0, *s1; unsigned qpitch; /* there is no 3D array texture */ @@ -228,7 +231,9 @@ tex_get_slice_stride(const struct ilo_texture *tex, unsigned level) } } - qpitch = tex->slice_offsets[level][1].y - tex->slice_offsets[level][0].y; + s0 = ilo_texture_get_slice(tex, level, 0); + s1 = ilo_texture_get_slice(tex, level, 1); + qpitch = s1->y - s0->y; assert(qpitch % tex->block_height == 0); return (qpitch / tex->block_height) * tex->bo_stride; |