载入中...
搜索中...
未找到
eve::gpgpu::Gpgpu类 参考

GPGPU module — compute shaders + storage buffers via the active Graphics backend. Uses the graphics queue when no dedicated compute family exists (Apple/MoltenVK). 更多...

#include <Gpgpu.h>

类 eve::gpgpu::Gpgpu 继承关系图:
eve::Module eve::IMeshDeformationCompute

Public 成员函数

 Module_REG (Gpgpu)
 
 Gpgpu ()
 Gpgpu.
 
 ~Gpgpu () override
 Gpgpu.
 
Result< std::vector< float > > deform (MeshDeformationComputeRequest request) override
 Execute mesh deformation through the active compute backend.
 
bool isAvailable () const
 True when the active Graphics backend can run compute (device initialized).
 
ComputeShader * newShader (const std::string &source)
 Compatibility-only raw-owning shader factory (Vulkan: GLSL; WebGPU: WGSL). Vulkan delegates to the checked compileComputeSpirv/createComputeShader APIs. Device thread only; caller must delete the shader before Graphics retires.
 
ComputeShader * newShaderFromBytecode (const std::string &path)
 Load precompiled compute bytecode from Filesystem path (Vulkan: SPIR-V).
 
ComputeShader * newShaderFromSpvFile (const std::string &path)
 Vulkan SPIR-V compatibility wrapper → newShaderFromBytecode.
 
GpuBuffer * newBuffer (int byteSize, const std::string &usage="storage")
 Allocate a GPU buffer. usage: "storage" (SSBO, device-local) | "staging" (host-visible transfer).
 
Sequence * newSequence ()
 Create a Kompute-style command Sequence: record buffer transfers and compute dispatches into one command buffer, then submit() once. Supported by both the Vulkan and WebGPU backends.
 
void dispatch (ComputeShader *shader, int groupsX, int groupsY=1, int groupsZ=1)
 Record + submit a compute dispatch and wait for completion (sync). groups*: workgroup counts (not thread counts).
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 
- Public 成员函数 继承自 eve::IMeshDeformationCompute
virtual ~IMeshDeformationCompute ()=default
 Releases IMeshDeformationCompute resources.
 

额外继承的成员函数

- 静态 Public 属性 继承自 eve::IMeshDeformationCompute
static constexpr const char * capabilityName = "eve.mesh-deformation-compute.v1"
 

详细描述

GPGPU module — compute shaders + storage buffers via the active Graphics backend. Uses the graphics queue when no dedicated compute family exists (Apple/MoltenVK).

Script: gpgpu <- eve.Gpgpu(); shader <- gpgpu.newShader(glsl); ECS: eve.ShaderSystem / eve.EcsShaderSystem bridge entity float fields to SSBOs.

在文件 Gpgpu.h 第 23 行定义.

构造及析构函数说明

◆ Gpgpu()

eve::gpgpu::Gpgpu::Gpgpu ( )

Gpgpu.

在文件 Gpgpu.cpp 第 200 行定义.

◆ ~Gpgpu()

eve::gpgpu::Gpgpu::~Gpgpu ( )
override

Gpgpu.

在文件 Gpgpu.cpp 第 202 行定义.

成员函数说明

◆ deform()

Result< std::vector< float > > eve::gpgpu::Gpgpu::deform ( MeshDeformationComputeRequest  request)
overridevirtual

Execute mesh deformation through the active compute backend.

实现了 eve::IMeshDeformationCompute.

在文件 Gpgpu.cpp 第 204 行定义.

引用了 b, c, count, dispatch(), error, eve::Diagnostic::error(), eve::Failed, eve::InvalidArgument, isAvailable(), n, newBuffer(), newShader(), normals, p, positions, request, shader, t , 以及 eve::Unsupported.

◆ dispatch()

void eve::gpgpu::Gpgpu::dispatch ( ComputeShader *  shader,
int  groupsX,
int  groupsY = 1,
int  groupsZ = 1 
)

Record + submit a compute dispatch and wait for completion (sync). groups*: workgroup counts (not thread counts).

在文件 Gpgpu.cpp 第 396 行定义.

引用了 shader, eve::gpgpu::vulkanDispatch() , 以及 eve::gpgpu::webgpuDispatch().

被这些函数引用 deform() , 以及 eve::gpgpu::ShaderSystem::dispatch().

◆ isAvailable()

bool eve::gpgpu::Gpgpu::isAvailable ( ) const

True when the active Graphics backend can run compute (device initialized).

在文件 Gpgpu.cpp 第 284 行定义.

引用了 eve::gpgpu::vulkanGpgpuReady() , 以及 eve::gpgpu::webgpuGpgpuReady().

被这些函数引用 deform().

◆ Module_REG()

eve::gpgpu::Gpgpu::Module_REG ( Gpgpu  )

◆ newBuffer()

GpuBuffer * eve::gpgpu::Gpgpu::newBuffer ( int  byteSize,
const std::string &  usage = "storage" 
)

Allocate a GPU buffer. usage: "storage" (SSBO, device-local) | "staging" (host-visible transfer).

在文件 Gpgpu.cpp 第 372 行定义.

引用了 usage, eve::gpgpu::vulkanNewBuffer() , 以及 eve::gpgpu::webgpuNewBuffer().

被这些函数引用 eve::tensor::GpuProgram::Impl::alloc(), eve::physics::ClothGPU::ClothGPU(), deform() , 以及 eve::gpgpu::ShaderSystem::ensureBuffer().

◆ newSequence()

Sequence * eve::gpgpu::Gpgpu::newSequence ( )

Create a Kompute-style command Sequence: record buffer transfers and compute dispatches into one command buffer, then submit() once. Supported by both the Vulkan and WebGPU backends.

在文件 Gpgpu.cpp 第 384 行定义.

被这些函数引用 eve::physics::ClothGPU::ClothGPU().

◆ newShader()

ComputeShader * eve::gpgpu::Gpgpu::newShader ( const std::string &  source)

Compatibility-only raw-owning shader factory (Vulkan: GLSL; WebGPU: WGSL). Vulkan delegates to the checked compileComputeSpirv/createComputeShader APIs. Device thread only; caller must delete the shader before Graphics retires.

在文件 Gpgpu.cpp 第 324 行定义.

引用了 eve::gpgpu::compileComputeSpirv(), eve::gpgpu::createComputeShader(), shader, source , 以及 eve::gpgpu::webgpuNewShaderFromWgsl().

被这些函数引用 eve::physics::ClothGPU::ClothGPU(), deform() , 以及 eve::gpgpu::ShaderSystem::setShaderSource().

◆ newShaderFromBytecode()

ComputeShader * eve::gpgpu::Gpgpu::newShaderFromBytecode ( const std::string &  path)

Load precompiled compute bytecode from Filesystem path (Vulkan: SPIR-V).

在文件 Gpgpu.cpp 第 341 行定义.

引用了 file, eve::gpgpu::loadSpirvFile(), path, eve::gpgpu::vulkanNewShaderFromSpirv() , 以及 eve::gpgpu::webgpuNewShaderFromWgsl().

被这些函数引用 newShaderFromSpvFile().

◆ newShaderFromSpvFile()

ComputeShader * eve::gpgpu::Gpgpu::newShaderFromSpvFile ( const std::string &  path)

Vulkan SPIR-V compatibility wrapper → newShaderFromBytecode.

在文件 Gpgpu.cpp 第 359 行定义.

引用了 newShaderFromBytecode() , 以及 path.


该类的文档由以下文件生成: