[Mesa-dev] [PATCH 0/6] Add a libmesautil library for sharing code between
Jason Ekstrand
jason at jlekstrand.net
Thu Jul 24 17:15:17 PDT 2014
There is a lot of code duplicated or awkwardly shared right now between
mesa/main, glsl, and gallium. It would be good to gather these useful
things into a central place that does not depend on any of the above.
People have talked about doing this from time to time; this series aims to
get the ball rolling. Right now, we just gather ralloc, hash_table, some
macros, and RGB <-> sRGB conversions.
Jason Ekstrand (4):
mesa/SConscript: Use Makefile.sources instead of duplicating the file
lists
util: Gather some common macros
gallium: Move sRGB <-> RGB handling to libmesautil
mesa/main: Use the RGB <-> sRGB conversion functions in libmesautil
Kenneth Graunke (2):
util: Move ralloc to a new src/util directory.
util: Move the open-addressing linear-probing hash_table to src/util.
configure.ac | 4 +-
src/Makefile.am | 2 +-
src/SConscript | 1 +
src/gallium/Automake.inc | 3 +
src/gallium/auxiliary/Makefile.am | 4 -
src/gallium/auxiliary/Makefile.sources | 1 -
src/gallium/auxiliary/SConscript | 8 +-
src/gallium/auxiliary/util/u_format_pack.py | 2 +-
src/gallium/auxiliary/util/u_format_s3tc.c | 2 +-
src/gallium/auxiliary/util/u_format_srgb.h | 147 ------
src/gallium/auxiliary/util/u_format_srgb.py | 155 -------
src/gallium/drivers/llvmpipe/SConscript | 2 +-
src/gallium/drivers/nouveau/Makefile.am | 1 +
src/gallium/drivers/nouveau/nv50/nv50_state.c | 2 +-
src/gallium/drivers/r300/Makefile.am | 3 +
src/gallium/drivers/r300/Makefile.sources | 1 -
.../drivers/r300/compiler/radeon_pair_regalloc.c | 2 +-
src/gallium/drivers/r300/ralloc.c | 1 -
src/gallium/state_trackers/dri/SConscript | 1 +
src/gallium/state_trackers/glx/xlib/SConscript | 1 +
src/gallium/targets/graw-gdi/SConscript | 1 +
src/gallium/targets/graw-null/SConscript | 2 +-
src/gallium/targets/graw-xlib/SConscript | 1 +
src/gallium/targets/libgl-xlib/SConscript | 2 +
src/gallium/targets/pipe-loader/Makefile.am | 1 +
src/gallium/tests/graw/SConscript | 2 +-
src/gallium/tests/unit/SConscript | 2 +-
src/glsl/Makefile.am | 17 +-
src/glsl/Makefile.sources | 1 -
src/glsl/SConscript | 5 +-
src/glsl/builtin_types.cpp | 7 +-
src/glsl/glcpp/glcpp.h | 2 +-
src/glsl/glsl_parser_extras.cpp | 2 +-
src/glsl/glsl_types.h | 2 +-
src/glsl/ir.h | 2 +-
src/glsl/ir_variable_refcount.cpp | 2 +-
src/glsl/link_uniform_block_active_visitor.h | 2 +-
src/glsl/link_uniform_blocks.cpp | 2 +-
src/glsl/list.h | 2 +-
src/glsl/opt_dead_code.cpp | 2 +-
src/glsl/ralloc.c | 492 ---------------------
src/glsl/ralloc.h | 444 -------------------
src/glsl/standalone_scaffolding.cpp | 2 +-
src/glsl/tests/builtin_variable_test.cpp | 1 -
src/glsl/tests/copy_constant_to_storage_tests.cpp | 2 +-
src/glsl/tests/general_ir_test.cpp | 1 -
src/glsl/tests/invalidate_locations_test.cpp | 2 +-
src/glsl/tests/ralloc_test.cpp | 38 --
src/glsl/tests/sampler_types_test.cpp | 1 -
src/glsl/tests/set_uniform_initializer_tests.cpp | 2 +-
src/glsl/tests/uniform_initializer_utils.cpp | 2 +-
src/glsl/tests/varyings_test.cpp | 2 +-
src/loader/Makefile.am | 1 +
src/mesa/Makefile.sources | 5 +-
src/mesa/SConscript | 342 +-------------
src/mesa/drivers/common/meta.c | 2 +-
src/mesa/drivers/common/meta_blit.c | 2 +-
src/mesa/drivers/dri/common/SConscript | 1 +
src/mesa/drivers/dri/i915/i830_context.c | 2 +-
src/mesa/drivers/dri/i915/i915_context.c | 2 +-
src/mesa/drivers/dri/i915/intel_context.c | 2 +-
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_clip.c | 2 +-
src/mesa/drivers/dri/i965/brw_context.c | 2 +-
src/mesa/drivers/dri/i965/brw_eu.c | 2 +-
src/mesa/drivers/dri/i965/brw_eu_emit.c | 2 +-
src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_gs.c | 2 +-
src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c | 2 +-
.../drivers/dri/i965/brw_performance_monitor.c | 2 +-
src/mesa/drivers/dri/i965/brw_program.c | 2 +-
src/mesa/drivers/dri/i965/brw_sf.c | 2 +-
src/mesa/drivers/dri/i965/brw_state_batch.c | 2 +-
src/mesa/drivers/dri/i965/brw_vs.c | 2 +-
src/mesa/drivers/dri/i965/brw_wm.c | 2 +-
src/mesa/drivers/dri/i965/gen8_generator.cpp | 2 +-
src/mesa/drivers/dri/i965/intel_fbo.c | 2 +-
src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
src/mesa/drivers/dri/i965/test_eu_compact.c | 2 +-
src/mesa/drivers/osmesa/Makefile.am | 1 +
src/mesa/drivers/osmesa/SConscript | 1 +
src/mesa/drivers/x11/SConscript | 2 +
src/mesa/main/compiler.h | 92 +---
src/mesa/main/errors.c | 2 +-
src/mesa/main/format_pack.c | 102 ++---
src/mesa/main/format_unpack.c | 69 +--
src/mesa/main/format_unpack.h | 3 -
src/mesa/main/hash.c | 2 +-
src/mesa/main/hash_table.c | 440 ------------------
src/mesa/main/hash_table.h | 106 -----
src/mesa/main/macros.h | 4 +-
src/mesa/main/performance_monitor.c | 2 +-
src/mesa/main/pipelineobj.c | 2 +-
src/mesa/main/set.c | 2 +-
src/mesa/main/shaderapi.c | 4 +-
src/mesa/main/shaderobj.c | 2 +-
src/mesa/main/shared.c | 2 +-
src/mesa/main/syncobj.c | 2 +-
src/mesa/main/tests/Makefile.am | 3 +-
src/mesa/main/tests/hash_table/.gitignore | 10 -
src/mesa/main/tests/hash_table/Makefile.am | 44 --
src/mesa/main/tests/hash_table/collision.c | 80 ----
src/mesa/main/tests/hash_table/delete_and_lookup.c | 74 ----
src/mesa/main/tests/hash_table/delete_management.c | 88 ----
src/mesa/main/tests/hash_table/destroy_callback.c | 66 ---
src/mesa/main/tests/hash_table/insert_and_lookup.c | 57 ---
src/mesa/main/tests/hash_table/insert_many.c | 72 ---
src/mesa/main/tests/hash_table/null_destroy.c | 37 --
src/mesa/main/tests/hash_table/random_entry.c | 88 ----
src/mesa/main/tests/hash_table/remove_null.c | 45 --
src/mesa/main/tests/hash_table/replacement.c | 64 ---
src/mesa/main/texcompress_etc.c | 19 +-
src/mesa/main/texcompress_s3tc.c | 25 +-
src/mesa/main/vdpau.c | 2 +-
src/mesa/program/register_allocate.c | 2 +-
src/mesa/swrast/s_texfetch.c | 30 +-
src/mesa/swrast/s_texfetch_tmp.h | 34 +-
src/util/Makefile.am | 61 +++
src/util/Makefile.sources | 6 +
src/util/SConscript | 35 ++
src/util/format_srgb.h | 148 +++++++
src/util/format_srgb.py | 155 +++++++
src/util/hash_table.c | 440 ++++++++++++++++++
src/util/hash_table.h | 106 +++++
src/util/macros.h | 128 ++++++
src/util/ralloc.c | 492 +++++++++++++++++++++
src/util/ralloc.h | 445 +++++++++++++++++++
src/util/tests/Makefile.am | 42 ++
src/util/tests/hash_table/.gitignore | 10 +
src/util/tests/hash_table/Makefile.am | 46 ++
src/util/tests/hash_table/collision.c | 80 ++++
src/util/tests/hash_table/delete_and_lookup.c | 74 ++++
src/util/tests/hash_table/delete_management.c | 88 ++++
src/util/tests/hash_table/destroy_callback.c | 66 +++
src/util/tests/hash_table/insert_and_lookup.c | 57 +++
src/util/tests/hash_table/insert_many.c | 72 +++
src/util/tests/hash_table/null_destroy.c | 37 ++
src/util/tests/hash_table/random_entry.c | 88 ++++
src/util/tests/hash_table/remove_null.c | 45 ++
src/util/tests/hash_table/replacement.c | 64 +++
src/util/tests/ralloc_test.cpp | 38 ++
142 files changed, 3034 insertions(+), 3257 deletions(-)
delete mode 100644 src/gallium/auxiliary/util/u_format_srgb.h
delete mode 100644 src/gallium/auxiliary/util/u_format_srgb.py
delete mode 120000 src/gallium/drivers/r300/ralloc.c
delete mode 100644 src/glsl/ralloc.c
delete mode 100644 src/glsl/ralloc.h
delete mode 100644 src/glsl/tests/ralloc_test.cpp
delete mode 100644 src/mesa/main/hash_table.c
delete mode 100644 src/mesa/main/hash_table.h
delete mode 100644 src/mesa/main/tests/hash_table/.gitignore
delete mode 100644 src/mesa/main/tests/hash_table/Makefile.am
delete mode 100644 src/mesa/main/tests/hash_table/collision.c
delete mode 100644 src/mesa/main/tests/hash_table/delete_and_lookup.c
delete mode 100644 src/mesa/main/tests/hash_table/delete_management.c
delete mode 100644 src/mesa/main/tests/hash_table/destroy_callback.c
delete mode 100644 src/mesa/main/tests/hash_table/insert_and_lookup.c
delete mode 100644 src/mesa/main/tests/hash_table/insert_many.c
delete mode 100644 src/mesa/main/tests/hash_table/null_destroy.c
delete mode 100644 src/mesa/main/tests/hash_table/random_entry.c
delete mode 100644 src/mesa/main/tests/hash_table/remove_null.c
delete mode 100644 src/mesa/main/tests/hash_table/replacement.c
create mode 100644 src/util/Makefile.am
create mode 100644 src/util/Makefile.sources
create mode 100644 src/util/SConscript
create mode 100644 src/util/format_srgb.h
create mode 100644 src/util/format_srgb.py
create mode 100644 src/util/hash_table.c
create mode 100644 src/util/hash_table.h
create mode 100644 src/util/macros.h
create mode 100644 src/util/ralloc.c
create mode 100644 src/util/ralloc.h
create mode 100644 src/util/tests/Makefile.am
create mode 100644 src/util/tests/hash_table/.gitignore
create mode 100644 src/util/tests/hash_table/Makefile.am
create mode 100644 src/util/tests/hash_table/collision.c
create mode 100644 src/util/tests/hash_table/delete_and_lookup.c
create mode 100644 src/util/tests/hash_table/delete_management.c
create mode 100644 src/util/tests/hash_table/destroy_callback.c
create mode 100644 src/util/tests/hash_table/insert_and_lookup.c
create mode 100644 src/util/tests/hash_table/insert_many.c
create mode 100644 src/util/tests/hash_table/null_destroy.c
create mode 100644 src/util/tests/hash_table/random_entry.c
create mode 100644 src/util/tests/hash_table/remove_null.c
create mode 100644 src/util/tests/hash_table/replacement.c
create mode 100644 src/util/tests/ralloc_test.cpp
--
2.0.1
More information about the mesa-dev
mailing list