8#include "flutter/fml/closure.h"
20 const std::weak_ptr<const ContextVK>& context)
21 : context_(context) {}
28 auto context = context_.lock();
32 auto recycler = context->GetCommandPoolRecycler();
36 auto tls_pool = recycler->Get();
41 auto tracked_objects = std::make_shared<TrackedObjectsVK>(
42 context, tls_pool, context->GetGPUTracer()->CreateGPUProbe());
43 auto queue = context->GetGraphicsQueue();
45 if (!tracked_objects || !tracked_objects->IsValid() || !
queue) {
49 vk::CommandBufferBeginInfo begin_info;
50 begin_info.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit;
51 if (tracked_objects->GetCommandBuffer().begin(begin_info) !=
52 vk::Result::eSuccess) {
57 if (label_.has_value()) {
58 context->SetDebugName(tracked_objects->GetCommandBuffer(), label_.value());
60 tracked_objects->GetGPUProbe().RecordCmdBufferStart(
61 tracked_objects->GetCommandBuffer());
63 return std::make_shared<CommandEncoderVK>(context->GetDeviceHolder(),
64 tracked_objects,
queue,
65 context->GetFenceWaiter());
69 std::weak_ptr<const DeviceHolderVK> device_holder,
70 std::shared_ptr<TrackedObjectsVK> tracked_objects,
71 const std::shared_ptr<QueueVK>&
queue,
72 std::shared_ptr<FenceWaiterVK> fence_waiter)
73 : device_holder_(
std::move(device_holder)),
74 tracked_objects_(
std::move(tracked_objects)),
76 fence_waiter_(
std::move(fence_waiter)) {}
88 tracked_objects_->GetGPUProbe().RecordCmdBufferEnd(command_buffer);
90 auto status = command_buffer.end();
91 if (status != vk::Result::eSuccess) {
99 if (tracked_objects_) {
100 return tracked_objects_->GetCommandBuffer();
105void CommandEncoderVK::Reset() {
106 tracked_objects_.reset();
116 tracked_objects_->Track(std::move(
object));
124 tracked_objects_->Track(std::move(
buffer));
129 const std::shared_ptr<const DeviceBuffer>&
buffer)
const {
133 return tracked_objects_->IsTracking(
buffer);
140 tracked_objects_->Track(std::move(
texture));
155 const std::shared_ptr<const Texture>&
texture)
const {
159 std::shared_ptr<const TextureSourceVK>
source =
161 return tracked_objects_->IsTracking(
source);
165 const vk::DescriptorSetLayout& layout,
171 return tracked_objects_->GetDescriptorPool().AllocateDescriptorSets(layout,
179 vk::DebugUtilsLabelEXT label_info;
180 label_info.pLabelName = label.data();
182 command_buffer.beginDebugUtilsLabelEXT(label_info);
191 command_buffer.endDebugUtilsLabelEXT();
199 vk::DebugUtilsLabelEXT label_info;
200 label_info.pLabelName = label.data();
202 command_buffer.insertDebugUtilsLabelEXT(label_info);
205 queue_->InsertDebugMarker(label);
static TextureVK & Cast(Texture &base)
std::shared_ptr< CommandEncoderVK > Create()
void SetLabel(const std::string &label)
CommandEncoderFactoryVK(const std::weak_ptr< const ContextVK > &context)
void PushDebugGroup(std::string_view label) const
bool Track(std::shared_ptr< SharedObjectVK > object)
bool EndCommandBuffer() const
CommandEncoderVK(std::weak_ptr< const DeviceHolderVK > device_holder, std::shared_ptr< TrackedObjectsVK > tracked_objects, const std::shared_ptr< QueueVK > &queue, std::shared_ptr< FenceWaiterVK > fence_waiter)
vk::CommandBuffer GetCommandBuffer() const
void PopDebugGroup() const
bool IsTracking(const std::shared_ptr< const DeviceBuffer > &texture) const
fml::StatusOr< vk::DescriptorSet > AllocateDescriptorSets(const vk::DescriptorSetLayout &layout, const ContextVK &context)
void InsertDebugMarker(std::string_view label) const
std::shared_ptr< const TextureSourceVK > GetTextureSource() const
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
bool HasValidationLayers()
static SkString to_string(int n)