class PipelineBuilder
Defined at line 22 of file ../../src/ui/lib/escher/vk/pipeline_builder.h
PipelineBuilder is responsible for building Vulkan pipelines and *managing* persistence of
VkPipelineCache data. This class doesn't know how to write data to e.g. disk; the client is
responsible for:
- providing a callback to actually persist the data
- calling |MaybeStorePipelineCacheData()| to trigger the callback
Public Methods
void PipelineBuilder (vk::Device device)
Create a pipeline builder which doesn't use a VkPipelineCache.
Defined at line 24 of file ../../src/ui/lib/escher/vk/pipeline_builder.cc
void PipelineBuilder (vk::Device device, const void * initial_cache_data, size_t initial_cache_data_size, StorePipelineCacheDataCallback store_data_callback)
Create a pipeline builder which creates a VkPipelineCache, which is used to accelerate pipeline
building. |store_data_callback| will be invoked during |MaybeStorePipelineCacheData()|, but
only if there is new data to store. If |initial_cache_data| is nullptr, then
|initial_cache_data_size| must be zero.
Defined at line 31 of file ../../src/ui/lib/escher/vk/pipeline_builder.cc
void ~PipelineBuilder ()
Defined at line 51 of file ../../src/ui/lib/escher/vk/pipeline_builder.cc
fxl::WeakPtr<PipelineBuilder> GetWeakPtr ()
Defined at line 52 of file ../../src/ui/lib/escher/vk/pipeline_builder.h
vk::Pipeline BuildGraphicsPipeline (const vk::GraphicsPipelineCreateInfo & info, bool do_logging)
Return a newly created pipeline, using the pipeline cache to accelerate creation if possible.
If |do_logging| is true, the callback set by set_log_pipeline_creation_callback() will be
invoked.
Defined at line 56 of file ../../src/ui/lib/escher/vk/pipeline_builder.cc
void set_log_pipeline_creation_callback (LogPipelineCreationCallback callback)
Set a callback that is invoked whenever a pipeline is built lazily. This is used by clients
who generate pipelines at startup, to be notified if they find themselves accidentally
generating pipelines in the middle of a frame. When the callback is invoked, one of the two
args will be nullptr and the other won't, depending on whether a graphics or compute pipeline
is being built.
Defined at line 59 of file ../../src/ui/lib/escher/vk/pipeline_builder.h
vk::Pipeline BuildComputePipeline (const vk::ComputePipelineCreateInfo & info, bool do_logging)
Defined at line 68 of file ../../src/ui/lib/escher/vk/pipeline_builder.cc
void MaybeStorePipelineCacheData ()
Invoke the |StorePipelineCacheDataCallback| that was passed to the constructor, but only if
there is updated cache data which needs to be persistently stored. The implementation takes
steps to efficiently exit early when there is no updated data to store, so it is OK to call
this fairly often.
Defined at line 79 of file ../../src/ui/lib/escher/vk/pipeline_builder.cc