diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-10-14 12:42:21 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-10-14 12:54:30 -0600 |
commit | 6d2d5ceca21c87bea5e269e8099fb6f1d821b97a (patch) | |
tree | 216e979f2b6d6d6604248d76ac5d8d9e37fc31df /src/gallium/drivers/cell/spu/spu_texture.c | |
parent | 58ea98dc68605130dda2538027f941df39ccd514 (diff) |
cell: use minify vs magnify filters
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_texture.c')
-rw-r--r-- | src/gallium/drivers/cell/spu/spu_texture.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_texture.c b/src/gallium/drivers/cell/spu/spu_texture.c index 10036330c6..267f2302f6 100644 --- a/src/gallium/drivers/cell/spu/spu_texture.c +++ b/src/gallium/drivers/cell/spu/spu_texture.c @@ -400,7 +400,7 @@ compute_lambda(uint unit, vector float s, vector float t) void sample_texture4_lod(vector float s, vector float t, vector float r, vector float q, - uint unit, uint level, vector float colors[4]) + uint unit, uint level_ignored, vector float colors[4]) { /* * Note that we're computing a lambda/lod here that's used for all @@ -417,13 +417,17 @@ sample_texture4_lod(vector float s, vector float t, else if (lambda > spu.sampler[unit].max_lod) lambda = spu.sampler[unit].max_lod; - /* convert to int level */ - level = (int) (lambda + 0.5f); - ASSERT(level >= 0); - - if (level > spu.texture[unit].max_level) - level = spu.texture[unit].max_level; - - sample_texture4_bilinear_2(s, t, r, q, unit, level, colors); + if (lambda <= 0.0f) { + /* magnify */ + spu.mag_sample_texture4[unit](s, t, r, q, unit, 0, colors); + } + else { + /* minify */ + int level = (int) (lambda + 0.5f); + if (level > (int) spu.texture[unit].max_level) + level = spu.texture[unit].max_level; + spu.min_sample_texture4[unit](s, t, r, q, unit, level, colors); + /* XXX to do: mipmap level interpolation */ + } } |