diff options
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 3a7ce9405e..25dbc2c244 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 7c836ba2c1..ce5bf0c8a9 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 116b59a067..44cc33b09f 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 2b79201313..6e106c16b0 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; |