draw: always call util_cpu_detect() in draw context creation.
authorRoland Scheidegger <sroland@vmware.com>
Tue, 23 Jul 2013 23:38:50 +0000 (01:38 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 24 Jul 2013 13:58:07 +0000 (15:58 +0200)
commit1e003b44e83dde3912ec48eb3df0e25802b5101e
tree6d0c89d72aef72a578dcc8a872cc0e1e9d339bce
parentbceb5f36ec9a8fdda515102c3e52f41aa6cad1c5
draw: always call util_cpu_detect() in draw context creation.

Since disabling denorms in draw_vbo() we require the util_cpu_caps to be
initialized there. Hence add another util_cpu_detect() call in
draw_create_context() which should ensure this.
(There is another call in draw_get_option_use_llvm() which only gets called
with x86 (not x86_64) but calling it always there wouldn't help since it most
likely wouldn't get called when compiling without llvm, so leave it alone
there.)
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=66806.
(Because util_cpu_caps wasn't initialized when first calling util_fpstate_get()
hence it returning zero, but it would later get initialized by rtasm translate
code hence when draw call returned it unmasked all exceptions by calling
util_fpstate_set(). This was happening only with DRAW_USE_LLVM=0 or not
compiling with llvm, otherwise the llvm init code was calling it on time too.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
src/gallium/auxiliary/draw/draw_context.c