From 344464bf2e4e151968cfb101c2477e440508b1f0 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 3 Oct 2007 20:33:23 +0200 Subject: Track fragment and vertex shader code generation via pipe shader state objects. Unfortunately, the generated fragment shader code is effectively unusable until it handles quad->mask. --- src/mesa/pipe/draw/draw_private.h | 3 --- src/mesa/pipe/draw/draw_vertex_shader.c | 16 ++++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mesa/pipe/draw') diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h index b3f1c4d23ea..79b2176c59c 100644 --- a/src/mesa/pipe/draw/draw_private.h +++ b/src/mesa/pipe/draw/draw_private.h @@ -124,9 +124,6 @@ struct draw_stage */ struct draw_vertex_shader { const struct pipe_shader_state *state; -#if defined(__i386__) || defined(__386__) - struct x86_function sse2_program; -#endif }; /** diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/mesa/pipe/draw/draw_vertex_shader.c index 49ff3b32ff4..e99537f16c2 100644 --- a/src/mesa/pipe/draw/draw_vertex_shader.c +++ b/src/mesa/pipe/draw/draw_vertex_shader.c @@ -214,12 +214,13 @@ draw_create_vertex_shader(struct draw_context *draw, vs->state = shader; #if defined(__i386__) || defined(__386__) - x86_init_func(&vs->sse2_program); - if (draw->use_sse) { - tgsi_emit_sse2(shader->tokens, &vs->sse2_program); - ((struct pipe_shader_state*)(vs->state))->executable = - x86_get_func(&vs->sse2_program); + x86_init_func( &shader->sse2_program ); + + tgsi_emit_sse2( shader->tokens, &shader->sse2_program ); + + ((struct pipe_shader_state *)shader)->executable = (void *) + x86_get_func( &shader->sse2_program ); } #endif @@ -243,9 +244,12 @@ void draw_delete_vertex_shader(struct draw_context *draw, void *vcso) { struct draw_vertex_shader *vs = (struct draw_vertex_shader*)(vcso); + #if defined(__i386__) || defined(__386__) - x86_release_func(&vs->sse2_program); + x86_release_func(&vs->state->sse2_program); #endif + + free(vs->state); free(vcso); } -- cgit v1.2.3