summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/spu/spu_main.h
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-12 12:53:49 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-12 12:53:49 -0700
commitd53e1c255aad83ee6c183f6e144d309327898669 (patch)
tree04bc0fbbddd86e0db20ae378953aef0cd54f21f9 /src/mesa/pipe/cell/spu/spu_main.h
parentdae719a68173bddedbb531c030cd4a12bcb0435b (diff)
Cell: collect vars in a spu_global struct
Diffstat (limited to 'src/mesa/pipe/cell/spu/spu_main.h')
-rw-r--r--src/mesa/pipe/cell/spu/spu_main.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/mesa/pipe/cell/spu/spu_main.h b/src/mesa/pipe/cell/spu/spu_main.h
index 9ef8cf0709..ea43224d02 100644
--- a/src/mesa/pipe/cell/spu/spu_main.h
+++ b/src/mesa/pipe/cell/spu/spu_main.h
@@ -30,10 +30,9 @@
#include "pipe/cell/common.h"
+#include "pipe/p_state.h"
-extern volatile struct cell_init_info init;
-
struct framebuffer {
void *color_start; /**< addr of color surface in main memory */
void *depth_start; /**< addr of depth surface in main memory */
@@ -44,11 +43,27 @@ struct framebuffer {
uint color_clear_value;
uint depth_clear_value;
-};
+} ALIGN16_ATTRIB;
+
+
+/**
+ * All SPU global/context state will be in singleton object of this type:
+ */
+struct spu_global
+{
+ struct cell_init_info init;
+
+ struct framebuffer fb;
+ struct pipe_depth_stencil_alpha_state depth_stencil;
+ struct pipe_blend_state blend;
+ /* XXX more state to come */
+
+} ALIGN16_ATTRIB;
+
+
+extern struct spu_global spu;
-/* XXX Collect these globals in a struct: */
-extern struct framebuffer fb;
/* DMA TAGS */
@@ -66,7 +81,7 @@ extern struct framebuffer fb;
#define ASSERT(x) \
if (!(x)) { \
fprintf(stderr, "SPU %d: %s:%d: %s(): assertion %s failed.\n", \
- init.id, __FILE__, __LINE__, __FUNCTION__, #x); \
+ spu.init.id, __FILE__, __LINE__, __FUNCTION__, #x); \
exit(1); \
}