summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_format_s3tc.h
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-04-02 04:48:42 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-04-02 06:16:30 +0200
commit52e9b990a192a9329006d5f7dd2ac222effea5a5 (patch)
tree18b64892f9384a5a5b94d66803d1465d071e53f0 /src/gallium/auxiliary/util/u_format_s3tc.h
parent6259264c57537896d72158f811674a192c6a1596 (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.h4
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