22CommandBufferVK::CommandBufferVK(
23 std::weak_ptr<const Context> context,
24 std::weak_ptr<const DeviceHolderVK> device_holder,
25 std::shared_ptr<TrackedObjectsVK> tracked_objects)
26 : CommandBuffer(
std::move(context)),
27 device_holder_(
std::move(device_holder)),
28 tracked_objects_(
std::move(tracked_objects)) {}
30CommandBufferVK::~CommandBufferVK() =
default;
32void CommandBufferVK::SetLabel(std::string_view label)
const {
34 auto context = context_.lock();
38 ContextVK::Cast(*context).SetDebugName(GetCommandBuffer(), label);
42bool CommandBufferVK::IsValid()
const {
46bool CommandBufferVK::OnSubmitCommands(
bool block_on_schedule,
51void CommandBufferVK::OnWaitUntilCompleted() {}
53void CommandBufferVK::OnWaitUntilScheduled() {}
55std::shared_ptr<RenderPass> CommandBufferVK::OnCreateRenderPass(
57 auto context = context_.lock();
62 std::shared_ptr<RenderPassVK>(
new RenderPassVK(context,
66 if (!pass->IsValid()) {
72std::shared_ptr<BlitPass> CommandBufferVK::OnCreateBlitPass() {
76 auto context = context_.lock();
80 auto pass = std::shared_ptr<BlitPassVK>(
new BlitPassVK(
81 shared_from_this(), ContextVK::Cast(*context).GetWorkarounds()));
82 if (!pass->IsValid()) {
88std::shared_ptr<ComputePass> CommandBufferVK::OnCreateComputePass() {
92 auto context = context_.lock();
97 std::shared_ptr<ComputePassVK>(
new ComputePassVK(context,
100 if (!pass->IsValid()) {
106bool CommandBufferVK::EndCommandBuffer()
const {
107 InsertDebugMarker(
"QueueSubmit");
109 auto command_buffer = GetCommandBuffer();
110 tracked_objects_->GetGPUProbe().RecordCmdBufferEnd(command_buffer);
112 auto status = command_buffer.end();
113 if (status != vk::Result::eSuccess) {
114 VALIDATION_LOG <<
"Failed to end command buffer: " << vk::to_string(status);
120vk::CommandBuffer CommandBufferVK::GetCommandBuffer()
const {
121 if (tracked_objects_) {
122 return tracked_objects_->GetCommandBuffer();
127bool CommandBufferVK::Track(
const std::shared_ptr<SharedObjectVK>&
object) {
131 tracked_objects_->Track(
object);
135bool CommandBufferVK::Track(
const std::shared_ptr<const DeviceBuffer>& buffer) {
139 tracked_objects_->Track(buffer);
143bool CommandBufferVK::Track(
144 const std::shared_ptr<const TextureSourceVK>&
texture) {
148 tracked_objects_->Track(
texture);
152bool CommandBufferVK::Track(
const std::shared_ptr<const Texture>&
texture) {
159 return Track(TextureVK::Cast(*texture).GetTextureSource());
163 const vk::DescriptorSetLayout& layout,
170 return tracked_objects_->GetDescriptorPool().AllocateDescriptorSets(
171 layout, pipeline_key, context);
174void CommandBufferVK::PushDebugGroup(std::string_view label)
const {
178 vk::DebugUtilsLabelEXT label_info;
179 label_info.pLabelName = label.data();
180 if (
auto command_buffer = GetCommandBuffer()) {
181 command_buffer.beginDebugUtilsLabelEXT(label_info);
185void CommandBufferVK::PopDebugGroup()
const {
189 if (
auto command_buffer = GetCommandBuffer()) {
190 command_buffer.endDebugUtilsLabelEXT();
194void CommandBufferVK::InsertDebugMarker(std::string_view label)
const {
198 vk::DebugUtilsLabelEXT label_info;
199 label_info.pLabelName = label.data();
200 if (
auto command_buffer = GetCommandBuffer()) {
201 command_buffer.insertDebugUtilsLabelEXT(label_info);
206 return tracked_objects_->GetDescriptorPool();
A per-frame descriptor pool. Descriptors from this pool don't need to be freed individually....
FlutterDesktopBinaryReply callback
#define FML_UNREACHABLE()
bool HasValidationLayers()