gallium: Remove util_format_s3tc_init()
authorMatt Turner <mattst88@gmail.com>
Thu, 28 Sep 2017 21:23:39 +0000 (14:23 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 3 Oct 2017 02:41:22 +0000 (19:41 -0700)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
14 files changed:
src/gallium/auxiliary/util/u_format_s3tc.c
src/gallium/auxiliary/util/u_format_s3tc.h
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_test_format.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/tests/unit/u_format_test.c

index 031255f2b3ff0dc578ab22d179f65c990ec9f196..3f755e53636a7e2d9b6c7db1546783d06e868c0a 100644 (file)
 #include "../../../mesa/main/texcompress_s3tc_tmp.h"
 
 
-static void
-util_format_dxt1_rgb_fetch_stub(int src_stride,
-                                const uint8_t *src,
-                                int col, int row,
-                                uint8_t *dst)
-{
-   assert(0);
-}
-
-
-static void
-util_format_dxt1_rgba_fetch_stub(int src_stride,
-                                 const uint8_t *src,
-                                 int col, int row,
-                                 uint8_t *dst )
-{
-   assert(0);
-}
-
-
-static void
-util_format_dxt3_rgba_fetch_stub(int src_stride,
-                                 const uint8_t *src,
-                                 int col, int row,
-                                 uint8_t *dst )
-{
-   assert(0);
-}
-
-
-static void
-util_format_dxt5_rgba_fetch_stub(int src_stride,
-                                 const uint8_t *src,
-                                 int col, int row,
-                                 uint8_t *dst )
-{
-   assert(0);
-}
+util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1;
+util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1;
+util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3;
+util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5;
 
-
-static void
-util_format_dxtn_pack_stub(int src_comps,
-                           int width, int height,
-                           const uint8_t *src,
-                           enum util_format_dxtn dst_format,
-                           uint8_t *dst,
-                           int dst_stride)
-{
-   assert(0);
-}
-
-
-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;
-util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = util_format_dxt5_rgba_fetch_stub;
-
-util_format_dxtn_pack_t util_format_dxtn_pack = util_format_dxtn_pack_stub;
-
-
-void
-util_format_s3tc_init(void)
-{
-   static boolean first_time = TRUE;
-
-   if (!first_time)
-      return;
-   first_time = FALSE;
-
-   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_dxtn_pack_t util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn;
 
 
 /*
index 42e62bdbb26c7984342329367065959f5ea094de..6f188c67f95091b9f32f4f42884d35af57ec5a34 100644 (file)
@@ -66,10 +66,6 @@ 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);
-
-
 void
 util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
 
index 040c2c99ec0a9b6f36f03e4274e57ae327261ccd..e8d84f477664384642601ee77b15b9392499b212 100644 (file)
@@ -884,8 +884,6 @@ fd_screen_create(struct fd_device *dev)
 
        slab_create_parent(&screen->transfer_pool, sizeof(struct fd_transfer), 16);
 
-       util_format_s3tc_init();
-
        return pscreen;
 
 fail:
index 8411c0f15cc1fd38a141b9cc509c19ba403bc77b..88e66ba684175cf2ab747edb1d16ea98e2b0e9f9 100644 (file)
@@ -628,7 +628,5 @@ i915_screen_create(struct i915_winsys *iws)
 
    i915_debug_init(is);
 
-   util_format_s3tc_init();
-
    return &is->base;
 }
index 7b694b5755147ac81c362361f5aa65d01cc74566..ab2ba3a19a8bbeaf9bbf5c683c9730349ec03c25 100644 (file)
@@ -682,7 +682,5 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
    }
    (void) mtx_init(&screen->rast_mutex, mtx_plain);
 
-   util_format_s3tc_init();
-
    return &screen->base;
 }
index fd79087287e054838a761428c75f30292d5623d1..e9a6e01fdcbf16d8bc7eba4ec30e72c4a47189ae 100644 (file)
@@ -357,8 +357,6 @@ test_all(unsigned verbose, FILE *fp)
    enum pipe_format format;
    boolean success = TRUE;
 
-   util_format_s3tc_init();
-
 #if USE_TEXTURE_CACHE
    cache_ptr = align_malloc(sizeof(struct lp_build_format_cache), 16);
 #endif
index 13b76d7681657b106fda453417014be4973d96c9..ea68809c6e8ed97afe9f6d002fadc6e659c7e384 100644 (file)
@@ -242,8 +242,6 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
 
    nouveau_disk_cache_create(screen);
 
-   util_format_s3tc_init();
-
    screen->lowmem_bindings = PIPE_BIND_GLOBAL; /* gallium limit */
    screen->vidmem_bindings =
       PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL |
index 6d6b5fb74ab16a2517a20be529e3a6b8bf1b716f..894c0d996b1a69b244e59925ebe07714c6e1504a 100644 (file)
@@ -773,7 +773,6 @@ struct pipe_screen* r300_screen_create(struct radeon_winsys *rws,
 
     slab_create_parent(&r300screen->pool_transfers, sizeof(struct pipe_transfer), 64);
 
-    util_format_s3tc_init();
     (void) mtx_init(&r300screen->cmask_mutex, mtx_plain);
 
     return &r300screen->screen;
index 0ab8113dc875263fbeb925dbfaa7bc3f2132556c..4fbcd3a65723d66cccaa7512589e335e0492f396 100644 (file)
@@ -1525,7 +1525,6 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
                       1 << util_logbase2(rscreen->force_aniso));
        }
 
-       util_format_s3tc_init();
        (void) mtx_init(&rscreen->aux_context_lock, mtx_plain);
        (void) mtx_init(&rscreen->gpu_load_mutex, mtx_plain);
 
index 1aceb5b75598a55f6c4f0f1f11b021b56a9b6ab9..495878bed9cdb9da1b55a80171754f62557936f3 100644 (file)
@@ -1493,7 +1493,6 @@ bool si_common_screen_init(struct r600_common_screen *rscreen,
                       1 << util_logbase2(rscreen->force_aniso));
        }
 
-       util_format_s3tc_init();
        (void) mtx_init(&rscreen->aux_context_lock, mtx_plain);
        (void) mtx_init(&rscreen->gpu_load_mutex, mtx_plain);
 
index 50eefe65af75ea769fde58cbab7277d1b505bb55..93fc76054caab621b20c183b809a73982c3547d1 100644 (file)
@@ -586,8 +586,6 @@ softpipe_create_screen(struct sw_winsys *winsys)
    screen->base.get_compute_param = softpipe_get_compute_param;
    screen->use_llvm = debug_get_option_use_llvm();
 
-   util_format_s3tc_init();
-
    softpipe_init_screen_texture_funcs(&screen->base);
    softpipe_init_screen_fence_funcs(&screen->base);
 
index 3ae56f52d5f06f054f7d911d0c218aea29b98fde..df23e354f48effc8df78056b85eb4a18c0870780 100644 (file)
@@ -1142,8 +1142,6 @@ swr_create_screen_internal(struct sw_winsys *winsys)
 
    swr_fence_init(&screen->base);
 
-   util_format_s3tc_init();
-
    swr_validate_env_options(screen);
 
    return &screen->base;
index f2636aac382d82c8fa7cb391c237147804eea49d..ecdd4758120792e3800b4f58ed8b03fa225542dd 100644 (file)
@@ -613,6 +613,5 @@ virgl_create_screen(struct virgl_winsys *vws)
 
    slab_create_parent(&screen->texture_transfer_pool, sizeof(struct virgl_transfer), 16);
 
-   util_format_s3tc_init();
    return &screen->base;
 }
index 2152b227f6a3570b8f0665d7f54e57a27f8300bf..6de581fd049de87b1fd93aa486f0cad3ccbbab49 100644 (file)
@@ -753,8 +753,6 @@ int main(int argc, char **argv)
 {
    boolean success;
 
-   util_format_s3tc_init();
-
    success = test_all();
 
    return success ? 0 : 1;