pass surface format in cell_command_framebuffer struct
authorBrian <brian.paul@tungstengraphics.com>
Thu, 3 Jan 2008 14:49:59 +0000 (07:49 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 3 Jan 2008 14:49:59 +0000 (07:49 -0700)
src/mesa/pipe/cell/common.h
src/mesa/pipe/cell/spu/main.c
src/mesa/pipe/cell/spu/main.h
src/mesa/pipe/cell/spu/tri.c

index ee20bd1..983ccd0 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "pipe/p_compiler.h"
 #include "pipe/p_util.h"
+#include "pipe/p_format.h"
 
 
 /** for sanity checking */
@@ -60,7 +61,7 @@ struct cell_command_framebuffer
 {
    void *start;
    int width, height;
-   unsigned format;
+   enum pipe_format format;
 } ALIGN16_ATTRIB;
 
 
index 94f1302..02b2386 100644 (file)
@@ -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;
index 47ce4be..3240e01 100644 (file)
@@ -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 */
 };
index 4e198e6..3707ebe 100644 (file)
@@ -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: