diff options
author | Kenneth Graunke <[email protected]> | 2014-02-25 01:08:45 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2014-08-04 11:07:05 -0700 |
commit | 72e55bb6888ff4d6b69b10d9c58573e4c3d492ec (patch) | |
tree | 9084fd3c939f545bbc0d6a214564755bca9745cb /src/glsl | |
parent | 1e0da6233be6e5fb0143615d5e3d3642ddb7964f (diff) |
util: Move the open-addressing linear-probing hash_table to src/util.
This hash table is used in core Mesa, the GLSL compiler, and the i965
driver, which makes it a good candidate for the new src/util module.
It's much faster than program/hash_table.[ch] (see commit 6991c2922f5
for data), and José's u_hash_table.c has a comment saying Gallium should
probably consider switching to a linear probing hash table at some point.
So this seems like the best candidate for a shared data structure.
Signed-off-by: Kenneth Graunke <[email protected]>
v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/Makefile.am | 4 | ||||
-rw-r--r-- | src/glsl/SConscript | 2 | ||||
-rw-r--r-- | src/glsl/ir_variable_refcount.cpp | 2 | ||||
-rw-r--r-- | src/glsl/link_uniform_block_active_visitor.h | 2 | ||||
-rw-r--r-- | src/glsl/link_uniform_blocks.cpp | 2 | ||||
-rw-r--r-- | src/glsl/opt_dead_code.cpp | 2 |
6 files changed, 4 insertions, 10 deletions
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am index 292c8f78775..2a20d119328 100644 --- a/src/glsl/Makefile.am +++ b/src/glsl/Makefile.am @@ -53,7 +53,6 @@ check_PROGRAMS = \ noinst_PROGRAMS = glsl_compiler tests_general_ir_test_SOURCES = \ - $(top_srcdir)/src/mesa/main/hash_table.c \ $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c\ $(top_srcdir)/src/mesa/program/symbol_table.c \ @@ -71,7 +70,6 @@ tests_general_ir_test_LDADD = \ $(PTHREAD_LIBS) tests_uniform_initializer_test_SOURCES = \ - $(top_srcdir)/src/mesa/main/hash_table.c \ $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c\ $(top_srcdir)/src/mesa/program/symbol_table.c \ @@ -120,7 +118,6 @@ libglsl_la_SOURCES = \ $(LIBGLSL_FILES) glsl_compiler_SOURCES = \ - $(top_srcdir)/src/mesa/main/hash_table.c \ $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c \ $(top_srcdir)/src/mesa/program/symbol_table.c \ @@ -131,7 +128,6 @@ glsl_compiler_LDADD = \ $(PTHREAD_LIBS) glsl_test_SOURCES = \ - $(top_srcdir)/src/mesa/main/hash_table.c \ $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c \ $(top_srcdir)/src/mesa/program/symbol_table.c \ diff --git a/src/glsl/SConscript b/src/glsl/SConscript index d1d5993d60a..847e9624685 100644 --- a/src/glsl/SConscript +++ b/src/glsl/SConscript @@ -58,7 +58,6 @@ if env['msvc']: # Copy these files to avoid generation object files into src/mesa/program env.Prepend(CPPPATH = ['#src/mesa/main']) -env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE')) env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE')) # Copy these files to avoid generation object files into src/mesa/program env.Prepend(CPPPATH = ['#src/mesa/program']) @@ -68,7 +67,6 @@ env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET' compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES']) mesa_objs = env.StaticObject([ - 'hash_table.c', 'imports.c', 'prog_hash_table.c', 'symbol_table.c', diff --git a/src/glsl/ir_variable_refcount.cpp b/src/glsl/ir_variable_refcount.cpp index 923eb1a8274..f67fe678443 100644 --- a/src/glsl/ir_variable_refcount.cpp +++ b/src/glsl/ir_variable_refcount.cpp @@ -33,7 +33,7 @@ #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" -#include "main/hash_table.h" +#include "util/hash_table.h" ir_variable_refcount_visitor::ir_variable_refcount_visitor() { diff --git a/src/glsl/link_uniform_block_active_visitor.h b/src/glsl/link_uniform_block_active_visitor.h index 524cd6b91d9..64de8268007 100644 --- a/src/glsl/link_uniform_block_active_visitor.h +++ b/src/glsl/link_uniform_block_active_visitor.h @@ -26,7 +26,7 @@ #define LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H #include "ir.h" -#include "main/hash_table.h" +#include "util/hash_table.h" struct link_uniform_block_active { const glsl_type *type; diff --git a/src/glsl/link_uniform_blocks.cpp b/src/glsl/link_uniform_blocks.cpp index fef3626bf02..0b1291d9a9b 100644 --- a/src/glsl/link_uniform_blocks.cpp +++ b/src/glsl/link_uniform_blocks.cpp @@ -26,7 +26,7 @@ #include "linker.h" #include "ir_uniform.h" #include "link_uniform_block_active_visitor.h" -#include "main/hash_table.h" +#include "util/hash_table.h" #include "program.h" namespace { diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp index da90bfb4045..3df01b4137d 100644 --- a/src/glsl/opt_dead_code.cpp +++ b/src/glsl/opt_dead_code.cpp @@ -31,7 +31,7 @@ #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" -#include "main/hash_table.h" +#include "util/hash_table.h" static bool debug = false; |