VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
metalDepthAwareBlurPass.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Depth-aware bilateral blur pass.
5//
6#pragma once
7
8#include <memory>
9#include <vector>
10#include <Metal/Metal.hpp>
11
12namespace visutwin::canvas
13{
14 class BlendState;
15 class DepthState;
17 class MetalComposePass;
20 class RenderTarget;
21 class Shader;
22 class Texture;
23
25
32 {
33 public:
34 MetalDepthAwareBlurPass(MetalGraphicsDevice* device, MetalComposePass* composePass, bool horizontal);
36
38 void execute(MTL::RenderCommandEncoder* encoder,
39 const DepthAwareBlurPassParams& params,
40 MetalRenderPipeline* pipeline, const std::shared_ptr<RenderTarget>& renderTarget,
41 const std::vector<std::shared_ptr<MetalBindGroupFormat>>& bindGroupFormats,
42 MTL::SamplerState* defaultSampler, MTL::DepthStencilState* defaultDepthStencilState);
43
44 private:
45 void ensureResources();
46
47 MetalGraphicsDevice* _device;
48 MetalComposePass* _composePass;
49 bool _horizontal;
50
51 std::shared_ptr<Shader> _shader;
52 std::shared_ptr<BlendState> _blendState;
53 std::shared_ptr<DepthState> _depthState;
54 MTL::DepthStencilState* _depthStencilState = nullptr;
55 };
56}
MetalDepthAwareBlurPass(MetalGraphicsDevice *device, MetalComposePass *composePass, bool horizontal)
void execute(MTL::RenderCommandEncoder *encoder, const DepthAwareBlurPassParams &params, MetalRenderPipeline *pipeline, const std::shared_ptr< RenderTarget > &renderTarget, const std::vector< std::shared_ptr< MetalBindGroupFormat > > &bindGroupFormats, MTL::SamplerState *defaultSampler, MTL::DepthStencilState *defaultDepthStencilState)
Execute the blur pass on the active render command encoder.
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.
Definition texture.h:57