From 0c4e89ad5b9cc9a3e2afdab86602f643e69e9412 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 18 Sep 2019 14:32:00 -0500 Subject: [PATCH] Move blob from compiler/ to util/ There's nothing whatsoever compiler-specific about it other than that's currently where it's used. Reviewed-by: Kristian H. Kristensen Reviewed-by: Lionel Landwerlin --- src/compiler/Makefile.sources | 2 -- src/compiler/glsl/tests/meson.build | 12 ------------ src/compiler/glsl_types.h | 2 +- src/compiler/meson.build | 2 -- src/compiler/nir/nir_serialize.h | 2 +- src/gallium/drivers/iris/iris_disk_cache.c | 2 +- src/intel/vulkan/anv_pipeline_cache.c | 2 +- src/mesa/drivers/dri/i965/brw_disk_cache.c | 2 +- src/mesa/main/program_binary.c | 2 +- src/mesa/state_tracker/st_shader_cache.h | 2 +- src/util/Makefile.sources | 2 ++ src/{compiler => util}/blob.c | 0 src/{compiler => util}/blob.h | 0 src/{compiler/glsl/tests => util}/blob_test.c | 0 src/util/meson.build | 15 +++++++++++++++ 15 files changed, 24 insertions(+), 23 deletions(-) rename src/{compiler => util}/blob.c (100%) rename src/{compiler => util}/blob.h (100%) rename src/{compiler/glsl/tests => util}/blob_test.c (100%) diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources index ac6c0670444..c4d2c2be7cb 100644 --- a/src/compiler/Makefile.sources +++ b/src/compiler/Makefile.sources @@ -1,6 +1,4 @@ LIBCOMPILER_FILES = \ - blob.c \ - blob.h \ builtin_type_macros.h \ glsl_types.cpp \ glsl_types.h \ diff --git a/src/compiler/glsl/tests/meson.build b/src/compiler/glsl/tests/meson.build index dc017ca4072..e9272fe5fbe 100644 --- a/src/compiler/glsl/tests/meson.build +++ b/src/compiler/glsl/tests/meson.build @@ -18,18 +18,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -test( - 'blob_test', - executable( - 'blob_test', - 'blob_test.c', - c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], - include_directories : [inc_common, inc_compiler], - link_with : [libglsl], - ), - suite : ['compiler', 'glsl'], -) - if with_shader_cache test( 'cache_test', diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index dcd7eea6dc0..10596603887 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -29,8 +29,8 @@ #include #include "shader_enums.h" -#include "blob.h" #include "c11/threads.h" +#include "util/blob.h" #include "util/macros.h" #ifdef __cplusplus diff --git a/src/compiler/meson.build b/src/compiler/meson.build index 108dc7eb10c..d4a40846fc7 100644 --- a/src/compiler/meson.build +++ b/src/compiler/meson.build @@ -24,8 +24,6 @@ inc_glsl = include_directories('glsl') inc_spirv = include_directories('spirv') files_libcompiler = files( - 'blob.c', - 'blob.h', 'builtin_type_macros.h', 'glsl_types.cpp', 'glsl_types.h', diff --git a/src/compiler/nir/nir_serialize.h b/src/compiler/nir/nir_serialize.h index f77d8e367ff..528988f5e4a 100644 --- a/src/compiler/nir/nir_serialize.h +++ b/src/compiler/nir/nir_serialize.h @@ -25,7 +25,7 @@ #define _NIR_SERIALIZE_H #include "nir.h" -#include "compiler/blob.h" +#include "util/blob.h" #ifdef __cplusplus extern "C" { diff --git a/src/gallium/drivers/iris/iris_disk_cache.c b/src/gallium/drivers/iris/iris_disk_cache.c index 325903c9861..2b5889c49e9 100644 --- a/src/gallium/drivers/iris/iris_disk_cache.c +++ b/src/gallium/drivers/iris/iris_disk_cache.c @@ -31,8 +31,8 @@ #include #include -#include "compiler/blob.h" #include "compiler/nir/nir.h" +#include "util/blob.h" #include "util/build_id.h" #include "util/disk_cache.h" #include "util/mesa-sha1.h" diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c index 7c9f8a6a8cd..9c315d5f44c 100644 --- a/src/intel/vulkan/anv_pipeline_cache.c +++ b/src/intel/vulkan/anv_pipeline_cache.c @@ -21,7 +21,7 @@ * IN THE SOFTWARE. */ -#include "compiler/blob.h" +#include "util/blob.h" #include "util/hash_table.h" #include "util/debug.h" #include "util/disk_cache.h" diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c index ccf389cfd79..1b4cb437cbc 100644 --- a/src/mesa/drivers/dri/i965/brw_disk_cache.c +++ b/src/mesa/drivers/dri/i965/brw_disk_cache.c @@ -21,10 +21,10 @@ * IN THE SOFTWARE. */ -#include "compiler/blob.h" #include "compiler/glsl/ir_uniform.h" #include "compiler/glsl/shader_cache.h" #include "main/mtypes.h" +#include "util/blob.h" #include "util/build_id.h" #include "util/debug.h" #include "util/disk_cache.h" diff --git a/src/mesa/main/program_binary.c b/src/mesa/main/program_binary.c index 39537cfccce..8c2db255246 100644 --- a/src/mesa/main/program_binary.c +++ b/src/mesa/main/program_binary.c @@ -29,12 +29,12 @@ */ -#include "compiler/blob.h" #include "compiler/glsl/serialize.h" #include "main/errors.h" #include "main/mtypes.h" #include "main/shaderapi.h" #include "util/bitscan.h" +#include "util/blob.h" #include "util/crc32.h" #include "program_binary.h" #include "program/prog_parameter.h" diff --git a/src/mesa/state_tracker/st_shader_cache.h b/src/mesa/state_tracker/st_shader_cache.h index 67cc084d600..2a74ea1e90a 100644 --- a/src/mesa/state_tracker/st_shader_cache.h +++ b/src/mesa/state_tracker/st_shader_cache.h @@ -25,9 +25,9 @@ #define ST_SHADER_CACHE_H #include "st_context.h" -#include "compiler/blob.h" #include "main/mtypes.h" #include "pipe/p_state.h" +#include "util/blob.h" #include "util/disk_cache.h" #include "util/mesa-sha1.h" diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources index cf8c848ea6d..109de1ebf6e 100644 --- a/src/util/Makefile.sources +++ b/src/util/Makefile.sources @@ -5,6 +5,8 @@ MESA_UTIL_FILES := \ bitscan.c \ bitscan.h \ bitset.h \ + blob.c \ + blob.h \ build_id.c \ build_id.h \ crc32.c \ diff --git a/src/compiler/blob.c b/src/util/blob.c similarity index 100% rename from src/compiler/blob.c rename to src/util/blob.c diff --git a/src/compiler/blob.h b/src/util/blob.h similarity index 100% rename from src/compiler/blob.h rename to src/util/blob.h diff --git a/src/compiler/glsl/tests/blob_test.c b/src/util/blob_test.c similarity index 100% rename from src/compiler/glsl/tests/blob_test.c rename to src/util/blob_test.c diff --git a/src/util/meson.build b/src/util/meson.build index c981a146de1..60989c924ea 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -29,6 +29,8 @@ files_mesa_util = files( 'bitscan.c', 'bitscan.h', 'bitset.h', + 'blob.c', + 'blob.h', 'build_id.c', 'build_id.h', 'crc32.c', @@ -144,6 +146,7 @@ deps_for_libmesa_util = [ dep_thread, dep_atomic, dep_m, + dep_valgrind, ] if with_platform_android @@ -202,6 +205,18 @@ if with_tests suite : ['util'], ) + test( + 'blob', + executable( + 'blob_test', + files('blob_test.c'), + include_directories : inc_common, + dependencies : idep_mesautil, + c_args : [c_msvc_compat_args], + ), + suite : ['util'], + ) + test( 'roundeven', executable( -- 2.30.2