summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_spu.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-09-26 09:38:40 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-09-26 10:15:35 -0600
commit164fb1299e1614ce05ae539d832567469eedb402 (patch)
tree139284449776638aa2d0372eb6c36d7ec7f333a2 /src/gallium/drivers/cell/ppu/cell_spu.c
parentf5127909fb0386c2c11a2c26886eb02808ed514e (diff)
cell: checkpoint: support for function calls in SPU shaders
Will be used for instructions like SIN/COS/POW/TEX/etc. The PPU needs to know the address of some functions in the SPU address space. Send that info to the PPU/main memory rather than patch up shaders on the SPU side. Not finished/tested yet...
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_spu.c')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_spu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_spu.c b/src/gallium/drivers/cell/ppu/cell_spu.c
index 9508227e29..df020c4146 100644
--- a/src/gallium/drivers/cell/ppu/cell_spu.c
+++ b/src/gallium/drivers/cell/ppu/cell_spu.c
@@ -36,6 +36,7 @@
#include "cell_spu.h"
#include "pipe/p_format.h"
#include "pipe/p_state.h"
+#include "util/u_memory.h"
#include "cell/common.h"
@@ -131,6 +132,11 @@ cell_start_spus(struct cell_context *cell)
ASSERT_ALIGN16(&cell_global.inits[0]);
ASSERT_ALIGN16(&cell_global.inits[1]);
+ /*
+ * Initialize the global 'inits' structure for each SPU.
+ * A pointer to the init struct will be passed to each SPU.
+ * The SPUs will then each grab their init info with mfc_get().
+ */
for (i = 0; i < cell->num_spus; i++) {
cell_global.inits[i].id = i;
cell_global.inits[i].num_spus = cell->num_spus;
@@ -141,6 +147,8 @@ cell_start_spus(struct cell_context *cell)
}
cell_global.inits[i].buffer_status = &cell->buffer_status[0][0][0];
+ cell_global.inits[i].spu_functions = &cell->spu_functions;
+
cell_global.spe_contexts[i] = spe_context_create(0, NULL);
if (!cell_global.spe_contexts[i]) {
fprintf(stderr, "spe_context_create() failed\n");