 |
Flutter Impeller
|
|
Go to the documentation of this file.
7 #include "flutter/fml/trace_event.h"
21 return parent_->GetBackendType();
25 return parent_->DescribeGpuModel();
29 return parent_->IsValid();
33 return parent_->GetResourceAllocator();
37 return parent_->GetShaderLibrary();
41 return parent_->GetSamplerLibrary();
45 return parent_->GetPipelineLibrary();
49 return parent_->CreateCommandBuffer();
53 return parent_->GetCommandQueue();
58 return parent_->GetCapabilities();
71 if (!swapchain || !swapchain->IsValid()) {
75 swapchain_ = std::move(swapchain);
80 TRACE_EVENT0(
"impeller", __FUNCTION__);
81 auto surface = swapchain_ ? swapchain_->AcquireNextDrawable() :
nullptr;
85 if (
auto pipeline_library = parent_->GetPipelineLibrary()) {
89 parent_->GetCommandPoolRecycler()->Dispose();
90 parent_->GetResourceAllocator()->DebugTraceMemoryStatistics();
95 swapchain_->UpdateSurfaceSize(size);
99 return parent_->GetDevice();
103 parent_->InitializeCommonlyUsedShadersIfNeeded();
std::unique_ptr< Surface > AcquireNextSurface()
const std::shared_ptr< ContextVK > & GetParent() const
bool SetWindowSurface(vk::UniqueSurfaceKHR surface, const ISize &size)
std::shared_ptr< SamplerLibrary > GetSamplerLibrary() const override
Returns the library of combined image samplers used in shaders.
~SurfaceContextVK() override
BackendType GetBackendType() const override
Get the graphics backend of an Impeller context.
bool SetSwapchain(std::shared_ptr< SwapchainVK > swapchain)
void InitializeCommonlyUsedShadersIfNeeded() const override
const vk::Device & GetDevice() const
void DidAcquireSurfaceFrame()
std::shared_ptr< CommandBuffer > CreateCommandBuffer() const override
Create a new command buffer. Command buffers can be used to encode graphics, blit,...
std::shared_ptr< ShaderLibrary > GetShaderLibrary() const override
Returns the library of shaders used to specify the programmable stages of a pipeline.
void UpdateSurfaceSize(const ISize &size) const
Mark the current swapchain configuration as dirty, forcing it to be recreated on the next frame.
const std::shared_ptr< const Capabilities > & GetCapabilities() const override
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
SurfaceContextVK(const std::shared_ptr< ContextVK > &parent)
static std::shared_ptr< SwapchainVK > Create(const std::shared_ptr< Context > &context, vk::UniqueSurfaceKHR surface, const ISize &size, bool enable_msaa=true)
std::string DescribeGpuModel() const override
static PipelineLibraryVK & Cast(PipelineLibrary &base)
std::shared_ptr< CommandQueue > GetCommandQueue() const override
Return the graphics queue for submitting command buffers.
std::shared_ptr< Allocator > GetResourceAllocator() const override
Returns the allocator used to create textures and buffers on the device.
std::shared_ptr< PipelineLibrary > GetPipelineLibrary() const override
Returns the library of pipelines used by render or compute commands.
bool IsValid() const override
Determines if a context is valid. If the caller ever receives an invalid context, they must discard i...
void Shutdown() override
Force all pending asynchronous work to finish. This is achieved by deleting all owned concurrent mess...