summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2007-09-28 07:33:54 -0400
committerZack Rusin <[email protected]>2007-09-28 12:29:30 -0400
commit8731e391f5a8bb45adb53242b0a473707c0c024c (patch)
treee1065a99cfd679a4063981524a705886da0a0b52 /src/mesa/pipe/draw
parenta1a989f0be8dc34082b52bb3b3a6eacb36d9e75e (diff)
Use sse only if GALLIUM_SSE is defined
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r--src/mesa/pipe/draw/draw_context.c11
-rw-r--r--src/mesa/pipe/draw/draw_context.h1
-rw-r--r--src/mesa/pipe/draw/draw_private.h2
-rw-r--r--src/mesa/pipe/draw/draw_vertex_shader.c9
4 files changed, 19 insertions, 4 deletions
diff --git a/src/mesa/pipe/draw/draw_context.c b/src/mesa/pipe/draw/draw_context.c
index 5efb173228f..3fb667ab1a9 100644
--- a/src/mesa/pipe/draw/draw_context.c
+++ b/src/mesa/pipe/draw/draw_context.c
@@ -41,6 +41,12 @@ struct draw_context *draw_create( void )
{
struct draw_context *draw = CALLOC_STRUCT( draw_context );
+#if defined(__i386__) || defined(__386__)
+ draw->use_sse = getenv("GALLIUM_SSE") != NULL;
+#else
+ draw->use_sse = false;
+#endif
+
/* create pipeline stages */
draw->pipeline.unfilled = draw_unfilled_stage( draw );
draw->pipeline.twoside = draw_twoside_stage( draw );
@@ -244,4 +250,9 @@ void draw_free_tmps( struct draw_stage *stage )
}
}
+boolean draw_use_sse(struct draw_context *draw)
+{
+ return draw->use_sse;
+}
+
diff --git a/src/mesa/pipe/draw/draw_context.h b/src/mesa/pipe/draw/draw_context.h
index 398e96d94d2..8e2232244cc 100644
--- a/src/mesa/pipe/draw/draw_context.h
+++ b/src/mesa/pipe/draw/draw_context.h
@@ -99,6 +99,7 @@ void draw_bind_vertex_shader(struct draw_context *draw,
void draw_delete_vertex_shader(struct draw_context *draw,
void *vcso);
+boolean draw_use_sse(struct draw_context *draw);
void
draw_set_vertex_buffer(struct draw_context *draw,
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h
index 2f52299f74a..12a970a6711 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/mesa/pipe/draw/draw_private.h
@@ -220,6 +220,8 @@ struct draw_context
struct prim_header queue[PRIM_QUEUE_LENGTH];
unsigned queue_nr;
} pq;
+
+ int use_sse : 1;
};
diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/mesa/pipe/draw/draw_vertex_shader.c
index f7ddbd19093..3518bd52a3f 100644
--- a/src/mesa/pipe/draw/draw_vertex_shader.c
+++ b/src/mesa/pipe/draw/draw_vertex_shader.c
@@ -220,10 +220,11 @@ draw_create_vertex_shader(struct draw_context *draw,
#if defined(__i386__) || defined(__386__)
x86_init_func(&vs->sse2_program);
- tgsi_emit_sse2(shader->tokens, &vs->sse2_program);
-
- ((struct pipe_shader_state*)(vs->state))->executable =
- x86_get_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);
+ }
#endif
return vs;