5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PASS_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PASS_VK_H_
23 std::shared_ptr<CommandBufferVK> command_buffer_;
25 std::array<uint32_t, 3> max_wg_size_ = {};
26 bool is_valid_ =
false;
29 std::array<vk::DescriptorImageInfo, kMaxBindings> image_workspace_;
30 std::array<vk::DescriptorBufferInfo, kMaxBindings> buffer_workspace_;
31 std::array<vk::WriteDescriptorSet, kMaxBindings + kMaxBindings>
33 size_t bound_image_offset_ = 0u;
34 size_t bound_buffer_offset_ = 0u;
35 size_t descriptor_write_offset_ = 0u;
36 bool has_label_ =
false;
37 bool pipeline_valid_ =
false;
38 vk::DescriptorSet descriptor_set_ = {};
39 vk::PipelineLayout pipeline_layout_ = {};
41 ComputePassVK(std::shared_ptr<const Context> context,
42 std::shared_ptr<CommandBufferVK> command_buffer);
45 bool IsValid()
const override;
48 void OnSetLabel(
const std::string& label)
override;
51 bool EncodeCommands()
const override;
54 void SetCommandLabel(std::string_view label)
override;
57 void SetPipeline(
const std::shared_ptr<Pipeline<ComputePipelineDescriptor>>&
61 void AddBufferMemoryBarrier()
override;
64 void AddTextureMemoryBarrier()
override;
72 const ShaderUniformSlot& slot,
73 const ShaderMetadata& metadata,
74 BufferView view)
override;
79 const SampledImageSlot& slot,
80 const ShaderMetadata& metadata,
81 std::shared_ptr<const Texture>
texture,
82 const std::unique_ptr<const Sampler>& sampler)
override;
84 bool BindResource(
size_t binding,
86 const BufferView& view);
~ComputePassVK() override
Compute passes encode compute shader into the underlying command buffer.