Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
ModuleInterface.h File Reference

Bridges an donner::gpu::shader::IrModule to the descriptors the GPU runtime consumes. More...

#include <vector>
#include "donner/gpu/Descriptors.h"
#include "donner/gpu/shader/IrModule.h"
Include dependency graph for ModuleInterface.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

std::vector< ComputeEntryPointInfodonner::gpu::shader::ComputeEntryPointsOf (const IrModule &module)
 Returns every compute entry point module declares, with the workgroup size each was built with, in declaration order.
ShaderResult< std::vector< ShaderBufferBindingInfo > > donner::gpu::shader::BufferBindingsOf (const IrModule &module)
 Computes buffer requirements for each entry point from its reachable resource references and the IR memory layout.

Detailed Description

Bridges an donner::gpu::shader::IrModule to the descriptors the GPU runtime consumes.

The runtime cannot read a workgroup size back out of compiled WGSL, MSL, or SPIR-V, so a shader module descriptor carries the compute entry points its source declares. Deriving that list from the IR the source was emitted from keeps the runtime's copy of the size from ever being transcribed by hand and drifting from the shader.

Function Documentation

◆ BufferBindingsOf()

ShaderResult< std::vector< ShaderBufferBindingInfo > > donner::gpu::shader::BufferBindingsOf ( const IrModule & module)

Computes buffer requirements for each entry point from its reachable resource references and the IR memory layout.

Runtime arrays require at least one element and report their stride. Unused bindings are omitted. The result is generated alongside source, never at draw time.

Parameters
moduleBuilt IR module the shader source was emitted from.

◆ ComputeEntryPointsOf()

std::vector< ComputeEntryPointInfo > donner::gpu::shader::ComputeEntryPointsOf ( const IrModule & module)

Returns every compute entry point module declares, with the workgroup size each was built with, in declaration order.

Empty for a module with no compute entry points.

Parameters
moduleBuilt IR module the shader source was emitted from.