summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/spu/spu_command.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-10-14 17:11:29 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-10-14 17:11:29 -0600
commit8f7c6b55ae962e30f32cfec9a14a652d3b5b5943 (patch)
treeaa457eab6b4c031888fdefd4f737d42b0e7ef248 /src/gallium/drivers/cell/spu/spu_command.c
parente0931e520a8d7cc5b4db8a4b887c5cf139b2647f (diff)
cell: support for cubemaps
Though, progs/demos/cubemap.c doesn't quite work right...
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_command.c')
-rw-r--r--src/gallium/drivers/cell/spu/spu_command.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_command.c b/src/gallium/drivers/cell/spu/spu_command.c
index b1efe97e76..c951fa6f31 100644
--- a/src/gallium/drivers/cell/spu/spu_command.c
+++ b/src/gallium/drivers/cell/spu/spu_command.c
@@ -301,7 +301,8 @@ cmd_state_framebuffer(const struct cell_command_framebuffer *cmd)
*/
static void
update_tex_masks(struct spu_texture *texture,
- const struct pipe_sampler_state *sampler)
+ const struct pipe_sampler_state *sampler,
+ uint unit)
{
uint i;
@@ -328,6 +329,11 @@ update_tex_masks(struct spu_texture *texture,
texture->level[i].scale_t = spu_splats(1.0f);
}
}
+
+ /* XXX temporary hack */
+ if (texture->target == PIPE_TEXTURE_CUBE) {
+ spu.sample_texture4[unit] = sample_texture4_cube;
+ }
}
@@ -378,7 +384,7 @@ cmd_state_sampler(const struct cell_command_sampler *sampler)
ASSERT(0);
}
- update_tex_masks(&spu.texture[unit], &spu.sampler[unit]);
+ update_tex_masks(&spu.texture[unit], &spu.sampler[unit], unit);
}
@@ -393,6 +399,7 @@ cmd_state_texture(const struct cell_command_texture *texture)
DEBUG_PRINTF("TEXTURE [%u]\n", texture->unit);
spu.texture[unit].max_level = 0;
+ spu.texture[unit].target = texture->target;
for (i = 0; i < CELL_MAX_TEXTURE_LEVELS; i++) {
uint width = texture->width[i];
@@ -408,6 +415,10 @@ cmd_state_texture(const struct cell_command_texture *texture)
spu.texture[unit].level[i].tiles_per_row =
(width + TILE_SIZE - 1) / TILE_SIZE;
+ spu.texture[unit].level[i].bytes_per_image =
+ 4 * ((width + TILE_SIZE - 1) & ~(TILE_SIZE-1))
+ * ((height + TILE_SIZE - 1) & ~(TILE_SIZE-1));
+
spu.texture[unit].level[i].max_s = spu_splats((int) width - 1);
spu.texture[unit].level[i].max_t = spu_splats((int) height - 1);
@@ -415,7 +426,7 @@ cmd_state_texture(const struct cell_command_texture *texture)
spu.texture[unit].max_level = i;
}
- update_tex_masks(&spu.texture[unit], &spu.sampler[unit]);
+ update_tex_masks(&spu.texture[unit], &spu.sampler[unit], unit);
//Debug=0;
}