summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/draw/draw_private.h2
-rw-r--r--src/mesa/pipe/draw/draw_vertex_shader.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h
index 44cf0b1c98..ac47d2a76f 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/mesa/pipe/draw/draw_private.h
@@ -124,7 +124,9 @@ 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 d8bd5a96d6..a2e64b1e4c 100644
--- a/src/mesa/pipe/draw/draw_vertex_shader.c
+++ b/src/mesa/pipe/draw/draw_vertex_shader.c
@@ -100,20 +100,20 @@ run_vertex_program(struct draw_context *draw,
draw_vertex_fetch( draw, machine, elts, count );
/* run shader */
- if( draw->vertex_shader->state->executable != NULL ) {
+#if defined(__i386__) || defined(__386__)
+ {
/* SSE */
- codegen_function func = (codegen_function) draw->vertex_shader->state->executable;
+ codegen_function func = (codegen_function) x86_get_func( &draw->vertex_shader->sse2_program );
func(
machine->Inputs,
machine->Outputs,
machine->Consts,
machine->Temps );
}
- else {
- /* interpreter */
- tgsi_exec_machine_run( machine );
- }
-
+#else
+ /* interpreter */
+ tgsi_exec_machine_run( machine );
+#endif
/* store machine results */
for (j = 0; j < count; j++) {
@@ -225,11 +225,9 @@ draw_create_vertex_shader(struct draw_context *draw,
/* cast-away const */
struct pipe_shader_state *sh = (struct pipe_shader_state *) shader;
- x86_init_func( &sh->sse2_program );
-
- tgsi_emit_sse2( sh->tokens, &sh->sse2_program );
+ x86_init_func( &vs->sse2_program );
- sh->executable = x86_get_func( &sh->sse2_program );
+ tgsi_emit_sse2( sh->tokens, &vs->sse2_program );
}
#endif
@@ -255,7 +253,7 @@ void draw_delete_vertex_shader(struct draw_context *draw,
struct draw_vertex_shader *vs = (struct draw_vertex_shader*)(vcso);
#if defined(__i386__) || defined(__386__)
- x86_release_func((struct x86_function *) &vs->state->sse2_program);
+ x86_release_func((struct x86_function *) &vs->sse2_program);
#endif
free((void *) vs->state);