Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::PipelineCompileQueueVulkan Class Reference

A task queue designed for managing compilation of pipeline state objects for Vulkan backend. More...

#include <pipeline_compile_queue_vulkan.h>

Inheritance diagram for impeller::PipelineCompileQueueVulkan:
impeller::PipelineCompileQueue

Public Member Functions

 ~PipelineCompileQueueVulkan () override
 
 PipelineCompileQueueVulkan (const PipelineCompileQueueVulkan &)=delete
 
PipelineCompileQueueVulkanoperator= (const PipelineCompileQueueVulkan &)=delete
 
void PostJob (const fml::closure &job) override
 Post a compilation job to the worker task runner.
 
void OnJobAdded () override
 Called by PostJobForDescriptor after a job has been successfully added to the queue. Subclasses must implement this to define their scheduling strategy.
 
- Public Member Functions inherited from impeller::PipelineCompileQueue
 PipelineCompileQueue ()=default
 
virtual ~PipelineCompileQueue ()
 
 PipelineCompileQueue (const PipelineCompileQueue &)=delete
 
PipelineCompileQueueoperator= (const PipelineCompileQueue &)=delete
 
bool PostJobForDescriptor (const PipelineDescriptor &desc, const fml::closure &job)
 Post a compile job for the specified descriptor.
 
void PerformJobEagerly (const PipelineDescriptor &desc)
 If the task has not yet been done, perform it eagerly on the calling thread. This can be used in lieu of an idle wait for the task completion on the calling thread.
 

Static Public Member Functions

static std::shared_ptr< PipelineCompileQueueVulkanCreate (std::shared_ptr< fml::BasicTaskRunner > worker_task_runner)
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::PipelineCompileQueue
void DoOneJob ()
 Execute one pending compilation job from the queue.
 
bool AddJob (const PipelineDescriptor &desc, const fml::closure &job)
 Add a compilation job to the pending queue for the specified descriptor.
 
bool HasPendingJobs ()
 Check if there are any pending compilation jobs in the queue.
 

Detailed Description

A task queue designed for managing compilation of pipeline state objects for Vulkan backend.

This subclass uses a fml::BasicTaskRunner as the worker task runner and dispatches compile jobs directly without sequential processing constraints.

Key characteristics:

  • Uses std::shared_ptr<fml::BasicTaskRunner> for worker_task_runner_
  • Dispatches jobs directly to the task runner in OnJobAdded()
  • Does not implement sequential processing like GLES version

The Vulkan backend benefits from the parallel nature of pipeline compilation, allowing multiple compile jobs to be processed concurrently through the task runner.

Definition at line 32 of file pipeline_compile_queue_vulkan.h.

Constructor & Destructor Documentation

◆ ~PipelineCompileQueueVulkan()

impeller::PipelineCompileQueueVulkan::~PipelineCompileQueueVulkan ( )
overridedefault

◆ PipelineCompileQueueVulkan()

impeller::PipelineCompileQueueVulkan::PipelineCompileQueueVulkan ( const PipelineCompileQueueVulkan )
delete

Member Function Documentation

◆ Create()

std::shared_ptr< PipelineCompileQueueVulkan > impeller::PipelineCompileQueueVulkan::Create ( std::shared_ptr< fml::BasicTaskRunner worker_task_runner)
static

Definition at line 12 of file pipeline_compile_queue_vulkan.cc.

13 {
14 if (!worker_task_runner) {
15 return nullptr;
16 }
17 return std::shared_ptr<PipelineCompileQueueVulkan>(
18 new PipelineCompileQueueVulkan(std::move(worker_task_runner)));
19}
PipelineCompileQueueVulkan(const PipelineCompileQueueVulkan &)=delete

Referenced by impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), and impeller::testing::TEST().

◆ OnJobAdded()

void impeller::PipelineCompileQueueVulkan::OnJobAdded ( )
overridevirtual

Called by PostJobForDescriptor after a job has been successfully added to the queue. Subclasses must implement this to define their scheduling strategy.

The default implementation for duplicate descriptors is to run the job eagerly. Subclasses can override this behavior by checking for duplicates before calling the base class.

Implements impeller::PipelineCompileQueue.

Definition at line 28 of file pipeline_compile_queue_vulkan.cc.

28 {
29 PostJob([weak_queue = weak_from_this()]() {
30 if (auto queue = std::static_pointer_cast<PipelineCompileQueueVulkan>(
31 weak_queue.lock())) {
32 queue->DoOneJob();
33 }
34 });
35}
void PostJob(const fml::closure &job) override
Post a compilation job to the worker task runner.
VkQueue queue
Definition main.cc:71

References PostJob(), and queue.

◆ operator=()

PipelineCompileQueueVulkan & impeller::PipelineCompileQueueVulkan::operator= ( const PipelineCompileQueueVulkan )
delete

◆ PostJob()

void impeller::PipelineCompileQueueVulkan::PostJob ( const fml::closure job)
overridevirtual

Post a compilation job to the worker task runner.

        This is a pure virtual function that must be implemented by
        subclasses. It is responsible for actually dispatching the
        job closure to the appropriate task runner for execution.
Parameters
[in]jobThe compilation job closure to post

Implements impeller::PipelineCompileQueue.

Definition at line 37 of file pipeline_compile_queue_vulkan.cc.

37 {
38 if (!job) {
39 return;
40 }
41
42 worker_task_runner_->PostTask(job);
43}

Referenced by OnJobAdded().


The documentation for this class was generated from the following files: