Mesa (master): gallium/util: revert util_format_init addition
Luca Barbieri
lb at kemper.freedesktop.org
Fri Apr 2 04:17:07 UTC 2010
Module: Mesa
Branch: master
Commit: 2a090ae80a597f498f113fe58a772ddf3dca12e0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a090ae80a597f498f113fe58a772ddf3dca12e0
Author: Luca Barbieri <luca at luca-barbieri.com>
Date: Fri Apr 2 04:51:50 2010 +0200
gallium/util: revert util_format_init addition
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 | 4 ----
src/gallium/auxiliary/util/u_format.c | 8 --------
src/gallium/auxiliary/util/u_format.h | 2 --
src/gallium/drivers/nv50/nv50_context.c | 2 --
src/gallium/drivers/softpipe/sp_screen.c | 2 +-
5 files changed, 1 insertions(+), 17 deletions(-)
diff --git a/progs/gallium/unit/u_format_test.c b/progs/gallium/unit/u_format_test.c
index 9883e1e..2fb7bad 100644
--- a/progs/gallium/unit/u_format_test.c
+++ b/progs/gallium/unit/u_format_test.c
@@ -30,10 +30,8 @@
#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;
diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c
index fae0a46..112490f 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -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();
-}
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index fc55040..2ac3aba 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -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
diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
index 0de75a7..92b194a 100644
--- a/src/gallium/drivers/nv50/nv50_context.c
+++ b/src/gallium/drivers/nv50/nv50_context.c
@@ -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;
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index df527f5..5c1012b 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -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);
More information about the mesa-commit
mailing list