5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_MTL_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_MTL_H_
8#include <Metal/Metal.h>
10#include "flutter/fml/macros.h"
25 id<MTLCommandBuffer> buffer_ = nil;
26 id<MTLComputeCommandEncoder> encoder_ = nil;
29 bool is_valid_ =
false;
30 bool has_label_ =
false;
33 id<MTLCommandBuffer>
buffer);
45 void OnSetLabel(
const std::string& label)
override;
63 std::shared_ptr<const Texture>
texture,
64 const std::unique_ptr<const Sampler>& sampler)
override;
bool IsValid() const override
void OnSetLabel(const std::string &label) override
void SetPipeline(const std::shared_ptr< Pipeline< ComputePipelineDescriptor > > &pipeline) override
fml::Status Compute(const ISize &grid_size) override
~ComputePassMTL() override
void SetCommandLabel(std::string_view label) override
void AddBufferMemoryBarrier() override
Ensures all previously encoded compute command's buffer writes are visible to any subsequent compute ...
void AddTextureMemoryBarrier() override
Ensures all previously encoded compute command's texture writes are visible to any subsequent compute...
bool BindResource(ShaderStage stage, DescriptorType type, const ShaderUniformSlot &slot, const ShaderMetadata &metadata, BufferView view) override
bool EncodeCommands() const override
Encode the recorded commands to the underlying command buffer.
Compute passes encode compute shader into the underlying command buffer.
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
static const uint8_t buffer[]
Ensures that bindings on the pass are not redundantly set or updated. Avoids making the driver do add...
Metadata required to bind a combined texture and sampler.