summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-11-05 17:20:35 -0700
committerBrian Paul <[email protected]>2008-11-05 17:20:35 -0700
commit88360913a730795d031b2ff20fe50d438ef1c151 (patch)
tree92ac889e48c7b333130247576051c8561d04c58f /src
parent2c204bbf7749ed0517c5826e2aae66997a0c4623 (diff)
cell: minor reformatting, var renaming
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index 28161d166e4..ae88d069122 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -28,6 +28,7 @@
* Authors:
* Keith Whitwell <[email protected]>
* Michel Dänzer <[email protected]>
+ * Brian Paul
*/
#include "pipe/p_context.h"
@@ -41,10 +42,10 @@
#include "cell_state.h"
#include "cell_texture.h"
-/* Simple, maximally packed layout.
- */
-static unsigned minify( unsigned d )
+
+static unsigned
+minify(unsigned d)
{
return MAX2(1, d>>1);
}
@@ -209,6 +210,7 @@ twiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
}
}
+
/**
* For Cell. Basically, rearrange the pixels/quads from this layout:
* +--+--+--+--+
@@ -238,22 +240,22 @@ twiddle_tile(const uint *tileIn, uint *tileOut)
}
}
+
/**
* Convert image from tiled layout to linear layout. 4-byte pixels.
*/
static void
untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
- uint src_stride, const uint *src)
+ uint dst_stride, const uint *src)
{
const uint tile_size2 = tile_size * tile_size;
const uint h_t = (h + tile_size - 1) / tile_size;
const uint w_t = (w + tile_size - 1) / tile_size;
uint *tile_buf;
-
uint it, jt; /* tile counters */
uint i, j; /* intra-tile counters */
- src_stride /= 4; /* convert from bytes to pixels */
+ dst_stride /= 4; /* convert from bytes to pixels */
tile_buf = align_malloc(tile_size * tile_size * 4, 16);
@@ -282,7 +284,7 @@ untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
uint dstj = jt * tile_size + j;
ASSERT(dsti < h);
ASSERT(dstj < w);
- dst[dsti * src_stride + dstj] = tsrc[i * tile_size + j];
+ dst[dsti * dst_stride + dstj] = tsrc[i * tile_size + j];
}
}
}
@@ -291,6 +293,7 @@ untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst,
align_free(tile_buf);
}
+
/**
* Convert linear texture image data to tiled format for SPU usage.
*/
@@ -341,6 +344,7 @@ cell_twiddle_texture(struct pipe_screen *screen,
pipe_buffer_unmap(screen, surface->buffer);
}
+
/**
* Convert SPU tiled texture image data to linear format for app usage.
*/