|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <platform/graphics/metal/metalParticleComputePass.h>
Public Member Functions | |
| void | advect (Texture *velocityTexture, const ParticleComputeUniforms &uniforms) |
| MTL::Buffer * | currentParticleBuffer () const |
| void | initialize (uint32_t maxParticles) |
| bool | isInitialized () const |
| True once initialize() has been called successfully. | |
| uint32_t | maxParticles () const |
| Get the particle count (set during initialize). | |
| MetalParticleComputePass (const MetalParticleComputePass &)=delete | |
| MetalParticleComputePass (MetalGraphicsDevice *device) | |
| MetalParticleComputePass & | operator= (const MetalParticleComputePass &)=delete |
| void | uploadParticles (const void *data, uint32_t count) |
| ~MetalParticleComputePass () | |
Manages GPU particle advection via a Metal compute kernel.
Owns the compute pipeline, double-buffered particle MTL::Buffers, and uniform buffer. Advection, aging, respawning, and boundary handling all happen on the GPU.
Definition at line 62 of file metalParticleComputePass.h.
|
explicit |
Definition at line 163 of file metalParticleComputePass.cpp.
Referenced by MetalParticleComputePass(), and operator=().
| visutwin::canvas::MetalParticleComputePass::~MetalParticleComputePass | ( | ) |
Definition at line 168 of file metalParticleComputePass.cpp.
|
delete |
References MetalParticleComputePass().
| void visutwin::canvas::MetalParticleComputePass::advect | ( | Texture * | velocityTexture, |
| const ParticleComputeUniforms & | uniforms ) |
Execute GPU advection for one timestep.
| velocityTexture | 3D texture (RGBA32Float): xyz = velocity, w unused. |
| uniforms | Per-frame parameters. |
Definition at line 287 of file metalParticleComputePass.cpp.
References visutwin::canvas::Texture::impl(), and visutwin::canvas::ParticleComputeUniforms::particleCount.
|
nodiscard |
Get the current (most recently written) particle buffer for rendering. The buffer contains maxParticles GPUParticle structs (48 bytes each).
Definition at line 350 of file metalParticleComputePass.cpp.
| void visutwin::canvas::MetalParticleComputePass::initialize | ( | uint32_t | maxParticles | ) |
Allocate particle buffers for the given capacity. Must be called before the first advect().
Definition at line 240 of file metalParticleComputePass.cpp.
References maxParticles().
|
inlinenodiscard |
True once initialize() has been called successfully.
Definition at line 95 of file metalParticleComputePass.h.
|
inlinenodiscard |
Get the particle count (set during initialize).
Definition at line 92 of file metalParticleComputePass.h.
Referenced by initialize(), and operator=().
|
delete |
References maxParticles(), and MetalParticleComputePass().
| void visutwin::canvas::MetalParticleComputePass::uploadParticles | ( | const void * | data, |
| uint32_t | count ) |
Upload initial particle data from CPU.
| data | Array of GPUParticle structs (48 bytes each). |
| count | Number of particles to upload. |
Definition at line 276 of file metalParticleComputePass.cpp.