diff options
author | Zack Rusin <[email protected]> | 2007-09-28 12:28:16 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-09-28 12:28:16 -0400 |
commit | 901577e07fcab0cf90a272fee900cb0831ae84c3 (patch) | |
tree | 9e8674230a3e584c674d0683de5d40321bd51fc1 /src/mesa/state_tracker | |
parent | f2a33a63f1f41681375baa2a9ad261cb60db2a85 (diff) |
Revert "Redoing the way we handle vertex shaders for the draw module."
This reverts commit 6dcfddb8e2ec2bfb6187b912807fa65f28da2c5e.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_program.c | 7 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.h | 4 |
4 files changed, 20 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 3a7ce9405e8..25dbc2c2442 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -86,6 +86,10 @@ static struct gl_program *st_new_program( GLcontext *ctx, prog->serialNo = 1; +#if defined(__i386__) || defined(__386__) + x86_init_func( &prog->sse2_program ); +#endif + return _mesa_init_vertex_program( ctx, &prog->Base, target, @@ -125,6 +129,9 @@ static void st_delete_program( GLcontext *ctx, case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *stvp = (struct st_vertex_program *) prog; +#if defined(__i386__) || defined(__386__) + x86_release_func( &stvp->sse2_program ); +#endif st_remove_vertex_program(st, stvp); } break; diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 7c836ba2c13..ce5bf0c8a94 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -405,7 +405,7 @@ st_feedback_draw_vbo(GLcontext *ctx, draw_set_viewport_state(draw, &st->state.viewport); draw_set_clip_state(draw, &st->state.clip); draw_set_rasterizer_state(draw, &st->state.rasterizer->state); - draw_bind_vertex_shader(draw, st->state.vs->data); + draw_set_vertex_shader(draw, &st->state.vs->state); /* XXX need to set vertex info too */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 116b59a067a..44cc33b09fb 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -253,6 +253,14 @@ st_translate_vertex_program(struct st_context *st, if (TGSI_DEBUG) tgsi_dump( tokensOut, 0 ); +#if defined(__i386__) || defined(__386__) + if (stvp->sse2_program.csr == stvp->sse2_program.store) + tgsi_emit_sse2( tokensOut, &stvp->sse2_program ); + + if (!cso->state.executable) + ((struct cso_vertex_shader*)cso)->state.executable = (void *) x86_get_func( &stvp->sse2_program ); +#endif + return cso; } diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 2b792013131..6e106c16b02 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -79,6 +79,10 @@ struct st_vertex_program /** The program in TGSI format */ struct tgsi_token tokens[ST_FP_MAX_TOKENS]; +#if defined(__i386__) || defined(__386__) + struct x86_function sse2_program; +#endif + /** Pointer to the corresponding cached shader */ const struct cso_vertex_shader *vs; |