![]() |
Vireo
0.0
Vireo 3D Rendering Hardware Interface
|
A compute pipeline is a GPU pipeline specialized for running general-purpose compute shaders (rather than the fixed‐function stages of graphics pipelines). It as a single programmable stage : the compute shader.
Because it omits all the fixed‐function graphics stages, the compute pipeline gives you maximum flexibility and performance for purely computational tasks on the GPU, executed in parallel.
Use cases of compute shaders :
For more information about compute pipelines and dispatching work read Compute with DirectX 12 by Stefan Pijnacker
A Compute pipeline is created with vireo::Vireo::createComputePipeline. Unlike graphic pipelines there is not configuration object since the is nothing to configure. Only the pipeline resources and the shader module are needed :
To execute the shader, bind the compute pipeline with vireo::CommandList::bindPipeline and its descriptor sets with vireo::CommandList::bindDescriptors, then issue a dispatch call with vireo::CommandList::dispatch specifying a 3D grid of workgroups.
Each workgroup invokes the compute shader on one or more GPU threads (they are very light threads compared to CPU threads).