summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_state_shader.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-09-11 17:59:52 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-09-11 17:59:52 -0600
commitaa66f08a21b791f338b519f0c2162cd8f7b3aeb0 (patch)
tree1e8c8e2e01f98759b9ab073d340daca837b65932 /src/gallium/drivers/cell/ppu/cell_state_shader.c
parentdbbbc333442c160b2801062e92c6c5931b64390a (diff)
cell: initial support for fragment shader code generation.
TGSI shaders are translated into SPE instructions which are then sent to the SPEs for execution. Only a few opcodes work, no swizzling yet, no support for constants/immediates, etc.
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_state_shader.c')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_shader.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c
index 97e44eeb1a..3a0d066da2 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_shader.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c
@@ -34,7 +34,7 @@
#include "cell_context.h"
#include "cell_state.h"
-
+#include "cell_gen_fp.h"
/** cast wrapper */
@@ -61,7 +61,7 @@ static void *
cell_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
- /*struct cell_context *cell = cell_context(pipe);*/
+ struct cell_context *cell = cell_context(pipe);
struct cell_fragment_shader_state *cfs;
cfs = CALLOC_STRUCT(cell_fragment_shader_state);
@@ -76,6 +76,8 @@ cell_create_fs_state(struct pipe_context *pipe,
tgsi_scan_shader(templ->tokens, &cfs->info);
+ cell_gen_fragment_program(cell, cfs->shader.tokens, &cfs->code);
+
return cfs;
}
@@ -102,6 +104,8 @@ cell_delete_fs_state(struct pipe_context *pipe, void *fs)
{
struct cell_fragment_shader_state *cfs = cell_fragment_shader_state(fs);
+ spe_release_func(&cfs->code);
+
FREE((void *) cfs->shader.tokens);
FREE(cfs);
}