gallivm: Require SSE2 for draw_llvm/llvmpipe due to LLVM PR6960.
authorTörök Edwin <edwintorok@gmail.com>
Thu, 6 May 2010 21:19:57 +0000 (22:19 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 6 May 2010 21:43:37 +0000 (22:43 +0100)
Note that this also requires X86 for llvm, if llvmpipe/draw_llvm works
on PPC then the condition should be extended to include && x86.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/drivers/llvmpipe/lp_screen.c

index ea9b7c90a51d16bfb468d68d1eac27db9548cf48..8295a439b972cdbde15875b2e02f362e807b2fcf 100644 (file)
@@ -161,9 +161,16 @@ create_vertex_header(struct draw_llvm *llvm, int data_elems)
 struct draw_llvm *
 draw_llvm_create(struct draw_context *draw)
 {
-   struct draw_llvm *llvm = CALLOC_STRUCT( draw_llvm );
+   struct draw_llvm *llvm;
 
+#ifdef PIPE_ARCH_X86
    util_cpu_detect();
+   /* require SSE2 due to LLVM PR6960. */
+   if (!util_cpu_caps.has_sse2)
+       return NULL;
+#endif
+
+   llvm = CALLOC_STRUCT( draw_llvm );
 
    llvm->draw = draw;
    llvm->engine = draw->engine;
index 111eedc4f239752fb87a508f4c5d375dd30a8d68..586afc8855c9a14d99de87a9f66a628d27aed834 100644 (file)
@@ -266,7 +266,16 @@ llvmpipe_destroy_screen( struct pipe_screen *_screen )
 struct pipe_screen *
 llvmpipe_create_screen(struct sw_winsys *winsys)
 {
-   struct llvmpipe_screen *screen = CALLOC_STRUCT(llvmpipe_screen);
+   struct llvmpipe_screen *screen;
+
+#ifdef PIPE_ARCH_X86
+   /* require SSE2 due to LLVM PR6960. */
+   util_cpu_detect();
+   if (!util_cpu_caps.has_sse2)
+       return NULL;
+#endif
+
+   screen = CALLOC_STRUCT(llvmpipe_screen);
 
 #ifdef DEBUG
    LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );