summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu/cell_state_sampler.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-28 17:23:44 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-28 18:18:46 -0700
commit425f270fcbfdbfce98adaf9da4b8eb7360f34447 (patch)
treeaeb424c4598456849ca32ac2b2ae90874edff9f7 /src/mesa/pipe/cell/ppu/cell_state_sampler.c
parentc2372cc7481bf3985a6a3126952ab9d5dab4bf77 (diff)
Cell: basic texture mapping
Texture images are tiled in PPU code. SPUs use a texture cache for getting texels from textures. This is very rough code, but demos/texcyl.c works.
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_state_sampler.c')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_sampler.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_state_sampler.c b/src/mesa/pipe/cell/ppu/cell_state_sampler.c
index ae1eeb4620..317f7603bb 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_sampler.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_sampler.c
@@ -30,12 +30,10 @@
*/
#include "pipe/p_util.h"
+#include "pipe/draw/draw_context.h"
#include "cell_context.h"
#include "cell_state.h"
-#if 0
#include "cell_texture.h"
-#include "cell_tile_cache.h"
-#endif
void *
@@ -53,6 +51,8 @@ cell_bind_sampler_state(struct pipe_context *pipe,
{
struct cell_context *cell = cell_context(pipe);
+ draw_flush(cell->draw);
+
assert(unit < PIPE_MAX_SAMPLERS);
cell->sampler[unit] = (struct pipe_sampler_state *)sampler;
@@ -76,7 +76,11 @@ cell_set_sampler_texture(struct pipe_context *pipe,
{
struct cell_context *cell = cell_context(pipe);
+ draw_flush(cell->draw);
+
cell->texture[sampler] = texture;
+ cell_update_texture_mapping(cell);
+
cell->dirty |= CELL_NEW_TEXTURE;
}