OSDN Git Service

anv: Add a struct for storing a compiled shader
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 25 Aug 2016 06:48:32 +0000 (23:48 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:47 +0000 (11:39 +0100)
commita8e4b59cfd7369b305db99b47bbccf7876bcdc68
tree37c72c148a852fb7148247a44c34fb4133562bf2
parent2566315063715cc9153a48e44f26e8ba9eb955ac
anv: Add a struct for storing a compiled shader

This new anv_shader_bin struct stores the compiled kernel (as an anv_state)
as well as all of the metadata that is generated at shader compile time.
The struct is very similar to the old cache_entry struct except that it
is reference counted and stores the actual pipeline_bind_map.  Similarly to
cache_entry, much of the actual data is floating-size and stored after the
main struct.  Unlike cache_entry, which was storred in GPU-accessable
memory, the storage for anv_shader_bin kernels comes from a state pool.
The struct itself is reference-counted so that it can be used by multiple
pipelines at a time without fear of allocation issues.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
(cherry picked from commit 689971847005219178f5a484dffecf9e5e515192)
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_pipeline_cache.c
src/intel/vulkan/anv_private.h