summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-04-01 14:52:04 -0600
committerBrian <[email protected]>2008-04-01 14:52:04 -0600
commit2d02ee85093d8068f11ecb286c5f02f52786cd95 (patch)
tree6375054de9a75ac03d04ad6f1798bdf22fe248ae /src/gallium
parente7b23d36df1ab3ac5b54ef8e4e56c4fd46db8257 (diff)
cell: fix bug in texture tiling function (non-square textures work now)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index c59d1f7f231..07717da8f6a 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -186,15 +186,17 @@ tile_copy_data(uint w, uint h, uint tile_size, uint *dst, const uint *src)
uint it, jt; /* tile counters */
uint i, j; /* intra-tile counters */
+ /* loop over dest tiles */
for (it = 0; it < h_t; it++) {
for (jt = 0; jt < w_t; jt++) {
- /* fill in tile (i, j) */
+ /* start of dest tile: */
uint *tdst = dst + (it * w_t + jt) * tile_size2;
+ /* loop over texels in the tile */
for (i = 0; i < tile_size; i++) {
for (j = 0; j < tile_size; j++) {
const uint srci = it * tile_size + i;
const uint srcj = jt * tile_size + j;
- *tdst++ = src[srci * h + srcj];
+ *tdst++ = src[srci * w + srcj];
}
}
}