summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_fs.c
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-20 07:50:33 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-20 07:50:33 -0400
commitdaf5b0f41baa50951e7c2f9ea5cd90b119085a7f (patch)
treed273c4ae95a8cb617412c9f7a1b943dc4364420f /src/mesa/state_tracker/st_atom_fs.c
parent37cf13ed9a429c755f121daa1776b1b30a985ab3 (diff)
Switch fragment/vertex shaders to the new caching semantics.
Allow driver custom allocation within cached objects. The shaders are currently twiced (by cso layer and by the program itself).
Diffstat (limited to 'src/mesa/state_tracker/st_atom_fs.c')
-rw-r--r--src/mesa/state_tracker/st_atom_fs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_fs.c b/src/mesa/state_tracker/st_atom_fs.c
index 94b69c8df7..91e58f5831 100644
--- a/src/mesa/state_tracker/st_atom_fs.c
+++ b/src/mesa/state_tracker/st_atom_fs.c
@@ -51,14 +51,14 @@
* Translate a Mesa fragment shader into a TGSI shader.
* \return pointer to cached pipe_shader object.
*/
-struct pipe_shader_state *
+const struct cso_fragment_shader *
st_translate_fragment_shader(struct st_context *st,
struct st_fragment_program *stfp)
{
GLuint outputMapping[FRAG_RESULT_MAX];
GLuint inputMapping[PIPE_MAX_SHADER_INPUTS];
struct pipe_shader_state fs;
- struct pipe_shader_state *cached;
+ const struct cso_fragment_shader *cso;
GLuint interpMode[16]; /* XXX size? */
GLuint i;
GLbitfield inputsRead = stfp->Base.Base.InputsRead;
@@ -142,15 +142,15 @@ st_translate_fragment_shader(struct st_context *st,
fs.tokens = &stfp->tokens[0];
- cached = st_cached_fs_state(st, &fs);
- stfp->fs = cached;
+ cso = st_cached_fs_state(st, &fs);
+ stfp->fs = cso;
if (TGSI_DEBUG)
tgsi_dump( stfp->tokens, 0/*TGSI_DUMP_VERBOSE*/ );
stfp->dirty = 0;
- return cached;
+ return cso;
}
@@ -183,7 +183,7 @@ static void update_fs( struct st_context *st )
if (stfp->dirty)
st->state.fs = st_translate_fragment_shader( st, st->fp );
- st->pipe->bind_fs_state(st->pipe, st->state.fs);
+ st->pipe->bind_fs_state(st->pipe, st->state.fs->data);
}
}