diff options
Diffstat (limited to 'src/gallium/auxiliary/util/u_half.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_half.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_half.c b/src/gallium/auxiliary/util/u_half.c index 4611b201b95..64eaa00dcc7 100644 --- a/src/gallium/auxiliary/util/u_half.c +++ b/src/gallium/auxiliary/util/u_half.c @@ -50,7 +50,6 @@ */ #include "util/u_half.h" -#include "util/u_init.h" uint32_t util_half_to_float_mantissa_table[2048]; uint32_t util_half_to_float_exponent_table[64]; @@ -58,10 +57,15 @@ uint32_t util_half_to_float_offset_table[64]; uint16_t util_float_to_half_base_table[512]; uint8_t util_float_to_half_shift_table[512]; -static void util_half_init_tables(void) +void util_half_init_tables(void) { + static boolean inited = FALSE; int i; + if (inited) { + return; + } + /* zero */ util_half_to_float_mantissa_table[0] = 0; @@ -153,6 +157,6 @@ static void util_half_init_tables(void) util_float_to_half_base_table[256 + i] = util_float_to_half_base_table[i] | 0x8000; util_float_to_half_shift_table[256 + i] = util_float_to_half_shift_table[i]; } -} -UTIL_INIT(util_half_init_tables); + inited = TRUE; +} |