diff options
author | Matt Turner <[email protected]> | 2017-09-28 14:16:18 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2017-10-02 19:41:22 -0700 |
commit | 3a8a5e77e8f992aaa3539e060885138c2fcddad1 (patch) | |
tree | 2eebf1d1150bee8d2d285a5f7dd761999f1700e2 /src/gallium/auxiliary | |
parent | f6c56e07fc5a8e81fd90688c9fee239f18c3480e (diff) |
gallium: Remove util_format_s3tc_enabled
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/util/u_format.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_format_s3tc.c | 54 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_format_s3tc.h | 2 |
3 files changed, 1 insertions, 59 deletions
diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c index a6d42a428dc..0fc32316548 100644 --- a/src/gallium/auxiliary/util/u_format.c +++ b/src/gallium/auxiliary/util/u_format.c @@ -242,10 +242,6 @@ util_format_is_supported(enum pipe_format format, unsigned bind) return FALSE; } - if (util_format_is_s3tc(format) && !util_format_s3tc_enabled) { - return FALSE; - } - #ifndef TEXTURE_FLOAT_ENABLED if ((bind & PIPE_BIND_RENDER_TARGET) && format != PIPE_FORMAT_R9G9B9E5_FLOAT && diff --git a/src/gallium/auxiliary/util/u_format_s3tc.c b/src/gallium/auxiliary/util/u_format_s3tc.c index 8c4f2150bef..031255f2b3f 100644 --- a/src/gallium/auxiliary/util/u_format_s3tc.c +++ b/src/gallium/auxiliary/util/u_format_s3tc.c @@ -28,17 +28,7 @@ #include "u_format.h" #include "u_format_s3tc.h" #include "util/format_srgb.h" - - -#if defined(_WIN32) || defined(WIN32) -#define DXTN_LIBNAME "dxtn.dll" -#elif defined(__CYGWIN__) -#define DXTN_LIBNAME "cygtxc_dxtn.dll" -#elif defined(__APPLE__) -#define DXTN_LIBNAME "libtxc_dxtn.dylib" -#else -#define DXTN_LIBNAME "libtxc_dxtn.so" -#endif +#include "../../../mesa/main/texcompress_s3tc_tmp.h" static void @@ -93,8 +83,6 @@ util_format_dxtn_pack_stub(int src_comps, } -boolean util_format_s3tc_enabled = FALSE; - util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = util_format_dxt1_rgb_fetch_stub; util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = util_format_dxt1_rgba_fetch_stub; util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = util_format_dxt3_rgba_fetch_stub; @@ -107,56 +95,16 @@ void util_format_s3tc_init(void) { static boolean first_time = TRUE; - struct util_dl_library *library = NULL; - util_dl_proc fetch_2d_texel_rgb_dxt1; - util_dl_proc fetch_2d_texel_rgba_dxt1; - util_dl_proc fetch_2d_texel_rgba_dxt3; - util_dl_proc fetch_2d_texel_rgba_dxt5; - util_dl_proc tx_compress_dxtn; if (!first_time) return; first_time = FALSE; - if (util_format_s3tc_enabled) - return; - - library = util_dl_open(DXTN_LIBNAME); - if (!library) { - debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn " - "compression/decompression unavailable\n"); - return; - } - - fetch_2d_texel_rgb_dxt1 = - util_dl_get_proc_address(library, "fetch_2d_texel_rgb_dxt1"); - fetch_2d_texel_rgba_dxt1 = - util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt1"); - fetch_2d_texel_rgba_dxt3 = - util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt3"); - fetch_2d_texel_rgba_dxt5 = - util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt5"); - tx_compress_dxtn = - util_dl_get_proc_address(library, "tx_compress_dxtn"); - - if (!util_format_dxt1_rgb_fetch || - !util_format_dxt1_rgba_fetch || - !util_format_dxt3_rgba_fetch || - !util_format_dxt5_rgba_fetch || - !util_format_dxtn_pack) { - debug_printf("couldn't reference all symbols in " DXTN_LIBNAME - ", software DXTn compression/decompression " - "unavailable\n"); - util_dl_close(library); - return; - } - util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1; util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1; util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3; util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5; util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn; - util_format_s3tc_enabled = TRUE; } diff --git a/src/gallium/auxiliary/util/u_format_s3tc.h b/src/gallium/auxiliary/util/u_format_s3tc.h index ae20010cdf8..42e62bdbb26 100644 --- a/src/gallium/auxiliary/util/u_format_s3tc.h +++ b/src/gallium/auxiliary/util/u_format_s3tc.h @@ -58,8 +58,6 @@ typedef void uint8_t *dst, int dst_stride); -extern boolean util_format_s3tc_enabled; - extern util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch; extern util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch; extern util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch; |