OSDN Git Service

anv: Rework pipeline caching
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 25 Aug 2016 08:49:49 +0000 (01:49 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:47 +0000 (11:39 +0100)
commit9a8d60539860d131a181e4d4ec446a5f5b699992
treefb2a4f49615f4bbcd057a8992b17fce270a4db37
parent17d40ca82b493f7ad34f1d71781069024aedeb3f
anv: Rework pipeline caching

The original pipeline cache the Kristian wrote was based on a now-false
premise that the shaders can be stored in the pipeline cache.  The Vulkan
1.0 spec explicitly states that the pipeline cache object is transiant and
you are allowed to delete it after using it to create a pipeline with no
ill effects.  As nice as Kristian's design was, it doesn't jive with the
expectation provided by the Vulkan spec.

The new pipeline cache uses reference-counted anv_shader_bin objects that
are backed by a large state pool.  The cache itself is just a hash table
mapping keys hashes to anv_shader_bin objects.  This has the added
advantage of removing one more hand-rolled hash table from mesa.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97476
Acked-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
(cherry picked from commit 10f9901bcef7724cb72fb2fe7e3dd8d6660d2f34)
src/intel/vulkan/anv_cmd_buffer.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/anv_pipeline_cache.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_l3.c
src/intel/vulkan/genX_pipeline.c
src/intel/vulkan/genX_pipeline_util.h