aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* anv: Rework pipeline cachingJason Ekstrand2016-08-301-312/+192
| | | | | | | | | | | | | | | | | | | 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 <[email protected]> Cc: "12.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97476 Acked-by: Kristian Høgsberg Kristensen <[email protected]>
* anv: Add a struct for storing a compiled shaderJason Ekstrand2016-08-301-0/+110
| | | | | | | | | | | | | | | | 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 <[email protected]> Cc: "12.0" <[email protected]> Acked-by: Kristian Høgsberg Kristensen <[email protected]>
* anv: Include the pipeline layout in the shader hashJason Ekstrand2016-08-241-0/+5
| | | | | | | | | | | | The pipeline layout affects shader compilation because it is what determines binding table locations as well as whether or not a particular buffer has dynamic offsets. Since this affects the generated shader, it needs to be in the hash. This fixes a bunch of CTS tests now that the CTS is using a pipeline cache. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline_cache: Allow for an zero-sized cacheJason Ekstrand2016-06-101-1/+4
| | | | | | | This gets ANV_ENABLE_PIPELINE_CACHE=false working again. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Add support for caching the push constant mapJason Ekstrand2016-06-061-4/+29
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* anv: Turn pipeline cache on by defaultKristian Høgsberg Kristensen2016-03-051-2/+3
| | | | | Move the environment variable check to cache creation time so we block both lookups and uploads if it's turned off.
* anv: Check if shader if present before uploading to cacheKristian Høgsberg Kristensen2016-03-051-7/+38
| | | | | | | Between the initial check the returns NO_KERNEL and compiling the shader, other threads may have added the shader to the cache. Before uploading the kernel, check again (under the mutex) that the compiled shader still isn't present.
* anv: Also cache the struct anv_pipeline_binding mapsKristian Høgsberg Kristensen2016-03-051-32/+80
| | | | | This is state the we generate when compiling the shaders and we need it for mapping resources from descriptor sets to binding table indices.
* anv: Don't re-upload shaders when mergingKristian Høgsberg Kristensen2016-03-051-10/+4
| | | | | | | Using anv_pipeline_cache_upload_kernel() will re-upload the kernel and prog_data when we merge caches. Since the kernel and prog_data is already in the program_stream, use anv_pipeline_cache_add_entry() instead to only add the entry to the hash table.
* anv: Add anv_pipeline_cache_add_entry()Kristian Høgsberg Kristensen2016-03-051-8/+15
| | | | This function will grow the cache to make room and then add the entry.
* anv: Rename anv_pipeline_cache_add_entry() to 'set'Kristian Høgsberg Kristensen2016-03-051-3/+3
| | | | | | This function is a helper that unconditionally sets a hash table entry and expects the cache to have enough room. Calling it 'add_entry' suggests it will grow the cache as needed.
* anv: Store prog data in pipeline cache streamKristian Høgsberg Kristensen2016-03-051-16/+23
| | | | | We have to keep it there for the cache to work, so let's not have an extra copy in struct anv_pipeline too.
* anv: Rename 'table' to 'hash_table' in anv_pipeline_cacheKristian Høgsberg Kristensen2016-03-051-16/+16
| | | | A little less ambiguous.
* anv: Serialize as much pipeline cache as we canKristian Høgsberg Kristensen2016-03-051-6/+17
| | | | | | We can serialize as much as the application asks for and just stop once we run out of memory. This lets applications use a fixed amount of space for caching and still get some benefit.
* anv: Use 1.0 pipeline cache headerKristian Høgsberg Kristensen2016-03-051-11/+25
| | | | The final version of the pipeline cache header adds a few more fields.
* anv: Fix shader key hashingKristian Høgsberg Kristensen2016-03-051-1/+1
| | | | | This was copied from inline code to a helper and wasn't updated to hash a pointer instead.
* anv: Remove excess whitespaceKristian Høgsberg Kristensen2016-03-051-12/+12
|
* Move the intel vulkan driver to src/intel/vulkanJason Ekstrand2016-02-181-0/+405