diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-04-02 04:48:42 +0200 |
---|---|---|
committer | Luca Barbieri <luca@luca-barbieri.com> | 2010-04-02 06:16:30 +0200 |
commit | 52e9b990a192a9329006d5f7dd2ac222effea5a5 (patch) | |
tree | 18b64892f9384a5a5b94d66803d1465d071e53f0 /src/gallium/auxiliary/util/u_format_s3tc.h | |
parent | 6259264c57537896d72158f811674a192c6a1596 (diff) |
gallium/util: load s3tc on demand
This changes the S3TC function pointers to be initialized to stubs
that load the S3TC library and then delegate to the real functions.
If the S3TC library fails to load, the function pointers are replaced
with a "nop" function.
The code is also changed to attempt to load the library only one time.c
Note that unlike checking for a flag, this method has no performance
cost at all.
The use of the "nop" functions also allows to avoid most checks, that
are only preserved when the function does non-trivial work.
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_s3tc.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_format_s3tc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_format_s3tc.h b/src/gallium/auxiliary/util/u_format_s3tc.h index 5c3a9dd22c..5be4bbec12 100644 --- a/src/gallium/auxiliary/util/u_format_s3tc.h +++ b/src/gallium/auxiliary/util/u_format_s3tc.h @@ -31,6 +31,7 @@ #include "pipe/p_compiler.h" +#include "util/u_inline_init.h" enum util_format_dxtn { @@ -65,8 +66,7 @@ extern util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch; extern util_format_dxtn_pack_t util_format_dxtn_pack; -void -util_format_s3tc_init(void); +UTIL_INLINE_INIT(util_format_s3tc); void |