summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-04-02 14:30:28 -0600
committerBrian <[email protected]>2008-04-03 19:43:10 -0600
commita7504ad587ee8cbfa9958ad23321a691ce0823d3 (patch)
tree18c7b0330da7eecdee10770fb4b2c0ec57a00127
parent217d37940771dd02ff1aa365105eca2c7a09d623 (diff)
cell: added some comments/ideas about better texture sampling
-rw-r--r--src/gallium/drivers/cell/spu/spu_texture.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_texture.c b/src/gallium/drivers/cell/spu/spu_texture.c
index e9a2754e571..5051774f00c 100644
--- a/src/gallium/drivers/cell/spu/spu_texture.c
+++ b/src/gallium/drivers/cell/spu/spu_texture.c
@@ -48,9 +48,16 @@ invalidate_tex_cache(void)
}
+/**
+ * XXX look into getting texels for all four pixels in a quad at once.
+ */
static uint
get_texel(uint unit, vec_uint4 coordinate)
{
+ /*
+ * XXX we could do the "/ TILE_SIZE" and "% TILE_SIZE" operations as
+ * SIMD since X and Y are already in a SIMD register.
+ */
const unsigned texture_ea = (uintptr_t) spu.texture[unit].start;
ushort x = spu_extract(coordinate, 0);
ushort y = spu_extract(coordinate, 1);
@@ -69,6 +76,16 @@ get_texel(uint unit, vec_uint4 coordinate)
/**
* Get four texels from locations (x[0], y[0]), (x[1], y[1]) ...
+ *
+ * NOTE: in the typical case of bilinear filtering, the four texels
+ * are in a 2x2 group so we could get by with just two dcache fetches
+ * (two side-by-side texels per fetch). But when bilinear filtering
+ * wraps around a texture edge, we'll probably need code like we have
+ * now.
+ * FURTHERMORE: since we're rasterizing a quad of 2x2 pixels at a time,
+ * it's quite likely that the four pixels in a quad will need some of the
+ * same texels. So look into doing texture fetches for four pixels at
+ * a time.
*/
static void
get_four_texels(uint unit, vec_uint4 x, vec_uint4 y, vec_uint4 *texels)
@@ -103,7 +120,6 @@ get_four_texels(uint unit, vec_uint4 x, vec_uint4 y, vec_uint4 *texels)
/**
* Get texture sample at texcoord.
- * XXX this is extremely primitive for now.
*/
vector float
sample_texture_nearest(uint unit, vector float texcoord)