summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/spu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-03 07:49:59 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-03 07:49:59 -0700
commit5cd96f7684adc7ba52a216fb676c7eb88ba3f66a (patch)
tree48a36245e27aef167d49fc47ae8474a257f17c62 /src/mesa/pipe/cell/spu
parent7aee3eff18decd6ce46f63a44c9a531414565265 (diff)
pass surface format in cell_command_framebuffer struct
Diffstat (limited to 'src/mesa/pipe/cell/spu')
-rw-r--r--src/mesa/pipe/cell/spu/main.c6
-rw-r--r--src/mesa/pipe/cell/spu/main.h1
-rw-r--r--src/mesa/pipe/cell/spu/tri.c3
3 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c
index 94f13029ff..02b23866a5 100644
--- a/src/mesa/pipe/cell/spu/main.c
+++ b/src/mesa/pipe/cell/spu/main.c
@@ -285,10 +285,12 @@ main_loop(void)
exitFlag = 1;
break;
case CELL_CMD_FRAMEBUFFER:
- printf("SPU %u: FRAMEBUFFER: %d x %d at %p\n", init.id,
+ printf("SPU %u: FRAMEBUFFER: %d x %d at %p, format 0x%x\n", init.id,
cmd.fb.width,
cmd.fb.height,
- cmd.fb.start);
+ cmd.fb.start,
+ cmd.fb.format);
+ fb.format = cmd.fb.format;
fb.width = cmd.fb.width;
fb.height = cmd.fb.height;
fb.width_tiles = (fb.width + TILE_SIZE - 1) / TILE_SIZE;
diff --git a/src/mesa/pipe/cell/spu/main.h b/src/mesa/pipe/cell/spu/main.h
index 47ce4be4b4..3240e01615 100644
--- a/src/mesa/pipe/cell/spu/main.h
+++ b/src/mesa/pipe/cell/spu/main.h
@@ -38,6 +38,7 @@ extern volatile struct cell_init_info init;
struct framebuffer {
void *start; /**< addr of surface in main memory */
+ enum pipe_format format;
uint width, height; /**< size in pixels */
uint width_tiles, height_tiles; /**< width and height in tiles */
};
diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c
index 4e198e638c..3707ebea45 100644
--- a/src/mesa/pipe/cell/spu/tri.c
+++ b/src/mesa/pipe/cell/spu/tri.c
@@ -234,8 +234,7 @@ pack_color(const float color[4])
uint g = (uint) (color[1] * 255.0);
uint b = (uint) (color[2] * 255.0);
uint a = (uint) (color[3] * 255.0);
- const enum pipe_format format = PIPE_FORMAT_A8R8G8B8_UNORM; /* XXX temp */
- switch (format) {
+ switch (fb.format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
return (a << 24) | (r << 16) | (g << 8) | b;
case PIPE_FORMAT_B8G8R8A8_UNORM: