summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-10-03 20:33:23 +0200
committerMichel Dänzer <[email protected]>2007-10-03 20:33:23 +0200
commit344464bf2e4e151968cfb101c2477e440508b1f0 (patch)
tree18bddd332b0b1af67246c985e976ee937d2ae600 /src/mesa/pipe/draw
parentce765a7fb77e12ff083a9068ec232a15bcf41f66 (diff)
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.
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r--src/mesa/pipe/draw/draw_private.h3
-rw-r--r--src/mesa/pipe/draw/draw_vertex_shader.c16
2 files changed, 10 insertions, 9 deletions
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);
}