gallium/util: revert util_format_init addition
authorLuca Barbieri <luca@luca-barbieri.com>
Fri, 2 Apr 2010 02:51:50 +0000 (04:51 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Fri, 2 Apr 2010 04:16:30 +0000 (06:16 +0200)
Putting calls to util_format_init all over the codebase is infeasible.

Instead, half float tables are pregenerated, and the s3tc library is
loaded on demand.

I believe this is a solution that combines performance, cleanliness,
flexibility and portability.

progs/gallium/unit/u_format_test.c
src/gallium/auxiliary/util/u_format.c
src/gallium/auxiliary/util/u_format.h
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/softpipe/sp_screen.c

index 9883e1e41ca74d703bbef60301d4d279b4b3fe52..2fb7badd6295f5c15f6749107be96486526439f1 100644 (file)
 #include <stdio.h>
 #include <float.h>
 
-#include "util/u_half.h"
 #include "util/u_format.h"
 #include "util/u_format_tests.h"
-#include "util/u_format_s3tc.h"
 
 
 static boolean
@@ -402,8 +400,6 @@ int main(int argc, char **argv)
 {
    boolean success;
 
-   util_format_init();
-
    success = test_all();
 
    return success ? 0 : 1;
index fae0a462dcbab38faaef435e58be061607a641e6..112490f3b41a04e68eb3c0bdd8c8044734c50f61 100644 (file)
@@ -117,11 +117,3 @@ util_format_write_4ub(enum pipe_format format, const uint8_t *src, unsigned src_
 
    format_desc->pack_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
 }
-
-boolean util_format_inited;
-
-void
-util_format_do_init(void)
-{
-   util_format_s3tc_init();
-}
index fc550405d8740b84aab2565c4d95c09fa63e2797..2ac3abab23ae95eeb18129e71a17f11a67b103c7 100644 (file)
@@ -552,8 +552,6 @@ util_format_write_4ub(enum pipe_format format,
                       void *dst, unsigned dst_stride, 
                       unsigned x, unsigned y, unsigned w, unsigned h);
 
-UTIL_INLINE_INIT(util_format);
-
 #ifdef __cplusplus
 } // extern "C" {
 #endif
index 0de75a70b98f5d8aa5746b3ebbf23fac6aeb0f61..92b194a8f828d66ffde7aeb16f955bddfef71926 100644 (file)
@@ -71,8 +71,6 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
        struct nv50_screen *screen = nv50_screen(pscreen);
        struct nv50_context *nv50;
 
-       util_format_init();
-
        nv50 = CALLOC_STRUCT(nv50_context);
        if (!nv50)
                return NULL;
index df527f5cb152b8bf5cd0ac42162881948402926c..5c1012b4006e4c551c43165741dd429ee404720a 100644 (file)
@@ -224,7 +224,7 @@ softpipe_create_screen(struct sw_winsys *winsys)
    screen->base.context_create = softpipe_create_context;
    screen->base.flush_frontbuffer = softpipe_flush_frontbuffer;
 
-   util_format_init();
+   util_format_s3tc_init();
 
    softpipe_init_screen_texture_funcs(&screen->base);
    softpipe_init_screen_buffer_funcs(&screen->base);