|
Monado OpenXR Runtime
|
Get-or-create cache of specialized compute pipelines that share one shader module and pipeline layout and differ only in specialization constant values. More...
#include <render/cache/render_compute_pipeline_cache.hpp>
Public Member Functions | |
| ComputePipelineCache (std::string_view name) | |
| void | init (VkShaderModule shader, VkPipelineLayout layout, VkPipelineCache pipelineCache) |
| Sets the borrowed Vulkan objects used to create pipelines. | |
| XRT_CHECK_RESULT VkResult | get (struct vk_bundle *vk, const Key &key, VkPipeline &out) |
| XRT_CHECK_RESULT VkResult | prewarm (struct vk_bundle *vk, std::span< const Key > keys) |
| void | destroy (struct vk_bundle *vk) |
Get-or-create cache of specialized compute pipelines that share one shader module and pipeline layout and differ only in specialization constant values.
Owns the pipelines it creates. The shader module, pipeline layout, and Vulkan pipeline cache supplied to init are borrowed and are never destroyed by this object.
Compute-only: creation needs just those borrowed objects plus specialization constants. Graphics pipelines need far more create-info (render pass or dynamic rendering formats, vertex input, rasterization, blend, and so on), so they cannot use this cache as-is.
| Key | A trivially-copyable, padding-free POD (see notes above). |
| void ComputePipelineCache< Key >::init | ( | VkShaderModule | shader, |
| VkPipelineLayout | layout, | ||
| VkPipelineCache | pipelineCache | ||
| ) |
Sets the borrowed Vulkan objects used to create pipelines.
The caller retains ownership and must keep these objects valid during calls to get and prewarm that may create a pipeline.