Compute graph

A directed acyclic graph of elements. The graph records its elements into one Vulkan command buffer per path, in dependency order, with memory barriers between consecutive elements.

Paths

A path is a numbered execution instance of the same graph, with its own recorded command buffers and per-path resources. In windowed rendering, pathId is the acquired swapchain image’s index. Separate paths let frames run concurrently without overwriting one another’s data; immutable model buffers may be shared.

For memory placement, CPU transfers and per-path buffer storage, see Buffers.

Graph

For timing measurements, warm-up, graph-chain readback and export, see Profiling.

class ComputeGraph
class ComputeGraphElement

Abstract base class representing an element in a compute graph.

ComputeGraphElement serves as the foundation for building computational graphs in the Klartraum framework. Each element can have multiple inputs and outputs, forming a directed acyclic graph structure for computation pipelines.

See also

ComputeGraph which is used to compile a compute graph from these elements.

Note

This class is designed to work with shared_ptr (ComputeGraphElementPtr) for automatic memory management and safe reference handling. Generally, you should not create instances of this class directly, but rather derive from it to implement specific compute graph elements and use the VulkanContext::create to instantiate them.

Subclassed by klartraum::GeneralComputation< GaussianMergePushConstants >, klartraum::GeneralComputation< GaussianTransformPushConstants >, klartraum::GeneralComputation< ImageResamplePushConstants >, klartraum::GeneralComputation< void >, klartraum::BufferElementInterface, klartraum::BufferToGraphicsBarrier, klartraum::ComputeGraphGroup, klartraum::CopyBuffer, klartraum::DepthAttachment, klartraum::DepthTransfer, klartraum::GeneralComputation< P >, klartraum::ImageSrc, klartraum::ImageViewSrcInterface, klartraum::ImageViewSrcTransition, klartraum::NoOp, klartraum::OnnxNetwork, klartraum::RenderGraphElement, klartraum::UniformBufferObjectInterface

Public Functions

template<int index = 0>
inline void setInput(ComputeGraphElementPtr input, int slot = -1)

Sets the input element for this ComputeGraphElement at the specified index.

If slot is used, this indicates that the input is not given by input directly, but rather by the slot element of the given element.

If slot is specified, retrieves the input element from the provided input’s slot and checks its validity. Updates the internal input and source output slot mappings.

Template Parameters:

index – The index at which to set the input (default is 0).

Parameters:
  • input – The ComputeGraphElementPtr to set as input.

  • slot – The slot of the input element to use (default is -1, meaning no slot). See explanation of slots above.

inline ComputeGraphElementPtr getOutputElement(int index = 0)

get the output with specified index

Generally simply returns the input at the given index. In the klartraum computegraph framework, each input is passed through the node, regardless of whether it is modified or not.

Parameters:

index –

Returns:

ComputeGraphElementPtr

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE)

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

inline void addDependency(const ComputeGraphElementPtr &dependency)

Adds an execution-only dependency that does not become a shader input.

Execution-only dependencies order accesses to shared physical resources, including reusable tensor-storage slots, without changing shader bindings.

Parameters:

dependency – Element that must execute before this element.

Throws:

std::invalid_argument – If dependency is null or refers to this element.

inline virtual std::vector<ComputeGraphElementPtr> getDependencies() const

Returns execution-only predecessors added with addDependency().

Depth attachments

See Gaussian splatting for raster and Gaussian composition.

class DepthAttachment : public klartraum::ComputeGraphElement

Per-path D32_SFLOAT images shared by raster passes and Gaussian splatting.

Public Functions

inline virtual void _setup(VulkanContext &context, uint32_t paths, VkQueue queue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

struct DepthState

Independent depth-test and depth-write controls; without an attachment neither is used.

Chains

class GraphChain

Compiled graphs submitted together, one after another on the GPU.

The links of the chain go to the queue in one vkQueueSubmit: link i + 1 waits for a semaphore link i signals, and a fence is signalled when the last link has finished. The CPU does nothing between the links, so data passes from graph to graph on the GPU only.

A graph may appear several times (e.g. one denoising step per link) if it was compiled after ComputeGraph::enableSimultaneousUse(). The host-side updates of every graph run once per submit(), before the chain is submitted. The graphs must not wait for semaphores of their own (ComputeGraph::setWaitFor()).

Public Functions

inline void add(ComputeGraph &graph, uint32_t pathId = 0)

Appends a path of a compiled graph to the chain.

inline void submit(VkQueue queue)

Submits the whole chain to queue in one vkQueueSubmit; wait() waits for it.

inline void wait()

Waits until the last submitted chain has finished.

Export

inline void klartraum::writeGraphJson(const std::filesystem::path &path, const std::string &name, const ComputeGraph &graph, const std::vector<ExportGroup> &groups)

Writes the structure of a compiled graph as JSON, for drawing it.

The elements in recording order (id), with name, type, the groups containing them and a key that is the same for an element in every graph it is part of (e.g. a tensor passed from one graph of a GraphChain to the next), and the edges as [predecessor id, element id]. With profiling enabled, each element also gets ms, its mean GPU time (ComputeGraph::getElementTimesMs()).

struct ExportGroup

A group of elements to mark in an exported graph, e.g. an ONNX network or a splatting backend.

Its members are the elements element depends on, without the boundary elements and what they depend on (the group’s inputs from outside).

Groups

Elements that are built from several graph elements.

class ComputeGraphGroup : public virtual klartraum::ComputeGraphElement

Base class for elements built from several graph elements, such as OnnxNetwork or the Gaussian splatting backends.

getInputs() returns the group’s output elements, so compiling a graph traverses from the group through its output elements back to all elements of the group.

Subclassed by klartraum::GaussianSplattingInterface, klartraum::OnnxNetwork

class RenderGraphElement : public virtual klartraum::ComputeGraphElement

Base class for graph elements that render with a camera; getCameraUBO() returns their camera uniform buffer input.

Subclassed by klartraum::GaussianSplattingInterface, klartraum::RenderPass

Buffers and tensors

The buffer allocation and interface types are documented in Buffers.

using klartraum::DispatchIndirectCommandBufferElement = BufferElement<VulkanBuffer<VkDispatchIndirectCommand>>

Buffer element holding the arguments of an indirect compute dispatch (vkCmdDispatchIndirect).

using klartraum::DrawIndirectCommandBufferElement = BufferElement<VulkanBuffer<VkDrawIndirectCommand>>

Buffer element holding the arguments of an indirect draw (vkCmdDrawIndirect).

template<typename T>
class HostValues : public klartraum::BufferElement<VulkanBuffer<T>>

A few values the CPU sets and shaders read, e.g. animation values.

set() only stores the values on the CPU. Right before a path of the graph is submitted, _update() copies them into that path’s storage buffer, so a value set between frames is seen by the next frame and paths still in flight keep theirs. Shaders read it as an array of T.

class TensorElementInterface : public klartraum::BufferElementInterface

Untemplated interface for tensor elements.

Subclassed by klartraum::TensorElement< DataType >

Public Functions

virtual const std::vector<uint32_t> &getDimensions() const = 0

Get tensor dimensions.

virtual void setDimensions(const std::vector<uint32_t> &newDimensions) = 0

Set the dimension data and update the dimensions buffer.

template<typename DataType>
class TensorElement : public klartraum::TensorElementInterface

TensorElement represents a tensor with separate dimension and data buffers.

This class manages GPU tensors with:

  • A dimensions buffer containing 4 uint32_t values [width, height, depth, batch]

  • A data buffer containing the actual tensor data of the specified type

The class follows the ComputeGraphElement pattern and manages multiple paths for different rendering/compute contexts.

Subclassed by klartraum::TensorElementSinglePath< DataType >

Public Functions

inline TensorElement(VulkanContext &vulkanContext, uint32_t batch, uint32_t depth, uint32_t height, uint32_t width, VkBufferUsageFlags dataUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, VkBufferUsageFlags dimUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)

Construct a TensorElement with specified dimensions.

Parameters:
  • vulkanContext – The Vulkan context for buffer creation

  • batch – Tensor batch dimension

  • depth – Tensor depth dimension

  • height – Tensor height dimension

  • width – Tensor width dimension

  • dataUsageFlags – Vulkan usage flags for the data buffer

  • dimUsageFlags – Vulkan usage flags for the dimensions buffer

inline TensorElement(VulkanContext &vulkanContext, const std::vector<uint32_t> &dimensions, VkBufferUsageFlags dataUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, VkBufferUsageFlags dimUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)

Construct a TensorElement with size of a dimensions vector.

Parameters:
  • vulkanContext – The Vulkan context for buffer creation

  • dimensions – Vector containing [width, height, depth, batch]

  • dataUsageFlags – Vulkan usage flags for the data buffer

  • dimUsageFlags – Vulkan usage flags for the dimensions buffer

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

inline virtual VulkanBuffer<DataType> &getDataBuffer(uint32_t pathId)

Get the data buffer for a specific path.

inline virtual VulkanBuffer<uint32_t> &getDimensionsBuffer()

Get the dimensions buffer.

inline virtual VkBuffer &getDataVkBuffer(uint32_t pathId) override

Get the Vulkan buffer handle for data buffer.

inline virtual VkBuffer &getDimensionsVkBuffer() override

Get the Vulkan buffer handle for dimensions buffer.

inline virtual const std::vector<uint32_t> &getDimensions() const override

Get tensor dimensions.

inline virtual void setDimensions(const std::vector<uint32_t> &newDimensions) override

Set the dimension data and update the dimensions buffer.

inline uint32_t getDataElementCount() const

Get number of data elements.

inline size_t getDataBufferMemSize() const

Get total memory size for data buffers.

inline size_t getDimensionsBufferMemSize() const

Get total memory size for dimensions buffers.

inline void setData(uint32_t pathId, const std::vector<DataType> &data)

Copy data to the data buffer for a specific compute path.

inline void setRecordToZero(bool recordDataToZero, bool recordDimensionsToZero = false)

Set whether to zero buffers during recording.

inline virtual size_t getBufferMemSize() const override

Returns the byte capacity of one buffer after setup.

inline virtual VkBuffer &getVkBuffer(uint32_t pathId) override

Returns the Vulkan handle for an initialized path.

template<typename DataType>
class TensorElementSinglePath : public klartraum::TensorElement<DataType>

TensorElementSinglePath represents a tensor with a single buffer.

This class is designed for constant/fixed tensors (weights, biases, initializers) that don’t change during execution and therefore only need a single buffer instead of multiple buffers for different paths.

Public Functions

inline TensorElementSinglePath(VulkanContext &vulkanContext, uint32_t batch, uint32_t depth, uint32_t height, uint32_t width, VkBufferUsageFlags dataUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, VkBufferUsageFlags dimUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)

Construct a TensorElementSinglePath with specified dimensions.

Parameters:
  • vulkanContext – The Vulkan context for buffer creation

  • batch – Tensor batch dimension

  • depth – Tensor depth dimension

  • height – Tensor height dimension

  • width – Tensor width dimension

  • dataUsageFlags – Vulkan usage flags for the data buffer

  • dimUsageFlags – Vulkan usage flags for the dimensions buffer

inline TensorElementSinglePath(VulkanContext &vulkanContext, const std::vector<uint32_t> &dimensions, VkBufferUsageFlags dataUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, VkBufferUsageFlags dimUsageFlags = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)

Construct a TensorElementSinglePath with specified dimensions.

Parameters:
  • vulkanContext – The Vulkan context for buffer creation

  • dimensions – Vector containing tensor dimensions

  • dataUsageFlags – Vulkan usage flags for the data buffer

  • dimUsageFlags – Vulkan usage flags for the dimensions buffer

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

inline virtual VulkanBuffer<DataType> &getDataBuffer(uint32_t pathId = -1) override

Get the data buffer for a specific path.

inline virtual VkBuffer &getDataVkBuffer(uint32_t pathId = -1) override

Get the Vulkan buffer handle for data buffer.

inline virtual VkBuffer &getVkBuffer(uint32_t pathId = -1) override

Returns the Vulkan handle for an initialized path.

template<typename UniformBufferObjectType>
class UniformBufferObject : public klartraum::UniformBufferObjectInterface

Public Functions

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

Computations

template<typename P = void>
class GeneralComputation : public klartraum::ComputeGraphElement

Public Functions

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE)

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

template<typename A, typename R, typename U = void, typename P = void>
class BufferTransformation : public klartraum::TemplatedBufferElementInterface<R>

Public Functions

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

inline virtual size_t getBufferMemSize() const override

Returns the byte capacity of one buffer after setup.

inline virtual VkBuffer &getVkBuffer(uint32_t pathId) override

Returns the Vulkan handle for an initialized path.

inline virtual R &getBuffer(uint32_t pathId) override

Returns the typed allocation for an initialized path.

class CopyBuffer : public klartraum::ComputeGraphElement

CopyBuffer element that copies data from source buffer to destination buffer.

This element performs a direct buffer copy operation using vkCmdCopyBuffer. Its main purpose is to copy a buffer so that consecutive operations on the data do not conflict between different operations.

Public Functions

inline CopyBuffer(VulkanContext &vulkanContext)

Construct a new CopyBuffer element.

Parameters:

vulkanContext – The Vulkan context for this element

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

class ImageResample : public klartraum::GeneralComputation<ImageResamplePushConstants>

Resamples an image into another image of any size.

Input 0 is the source image, input 1 the destination; both are ImageViewSrc elements (or elements passing one through a slot) whose format stores as rgba8, such as OffscreenTarget or the swapchain. The whole destination is written, so its previous contents are discarded.

The source is read in VK_IMAGE_LAYOUT_GENERAL, transitioned from srcLayout (e.g. TRANSFER_SRC_OPTIMAL for an OffscreenTarget a splatting backend rendered into). Both images are left in GENERAL.

enum class klartraum::ResampleFilter : uint32_t

Filter that ImageResample uses to sample the source image.

Values:

enumerator Nearest
enumerator Bilinear

Rendering

For clearing, image composition and shared images, see Render targets and image composition and Render targets and image composition.

class RenderPass : public klartraum::ImageViewSrc, public klartraum::RenderGraphElement

Public Functions

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE)

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.

inline void setLoadExisting(bool load)

Draw over the image’s contents instead of clearing it first.

The pass transitions from its color producer’s reported output layout to VK_IMAGE_LAYOUT_GENERAL while preserving the contents. Call before compilation.

class ImageViewSrc : public virtual klartraum::ImageViewSrcInterface

The images a graph renders into or reads, one per path.

By default the source clears its image to opaque black every time its path runs, before any element that uses it, and leaves it in VK_IMAGE_LAYOUT_GENERAL: renderers such as the Gaussian-splatting backends draw over what the image holds, so a fresh frame starts from black. setClear(false) keeps the previous contents instead; the image must then already be in VK_IMAGE_LAYOUT_GENERAL. Clearing needs images created with VK_IMAGE_USAGE_TRANSFER_DST_BIT.

Subclassed by klartraum::ImageViewForward, klartraum::OffscreenTarget, klartraum::RenderPass, klartraum::SinglePathImage

Public Functions

inline void setClear(bool clear)

Whether the image is cleared each time its path runs (default: yes).

inline void setClearColor(const VkClearColorValue &color)

The color the image is cleared to (default: opaque black).

class ImageViewForward : public klartraum::ImageViewSrc

Stands for the images of the ImageViewSrc at input 0, e.g. a target another element (at an output slot) writes: elements that use it then run after that element. It does not clear the images.

Subclassed by klartraum::ClearImage, klartraum::GaussianSplattingInterface, klartraum::ImageComposite

class ClearImage : public klartraum::ImageViewForward

Clears the images of the ImageViewSrc at input 0 to a color and stands for them: connect renderers to it instead of the source.

For sources that do not clear themselves (ImageViewSrc::setClear(false)) or should start from another color than black. The images are left in VK_IMAGE_LAYOUT_GENERAL.

class ImageComposite : public klartraum::ImageViewForward

Draws a source image onto a target and stands for the target’s images: connect a renderer to it to render over the result.

The target is written in place, per path, and keeps its contents where the source is not drawn (or shows through, with CompositeMode::Over); it must be in VK_IMAGE_LAYOUT_GENERAL, as ImageViewSrc leaves it. The source is only read, so it may be an image every path shares, such as a SinglePathImage. Both are ImageViewSrc elements (or elements passing one through a slot) whose format stores as rgba8. Set the source, then the target.

Public Functions

inline ImageComposite(VulkanContext &vulkanContext, VkExtent2D sourceExtent, VkExtent2D targetExtent, CompositeMode mode = CompositeMode::Replace, CompositeFit fit = CompositeFit::Stretch, VkImageLayout sourceLayout = VK_IMAGE_LAYOUT_GENERAL)
Parameters:
  • vulkanContext – The context the draw computation runs in.

  • sourceExtent – The extent of the source image.

  • targetExtent – The extent of the target image.

  • mode – How the source’s pixels combine with the target’s.

  • fit – Where the source is drawn on the target.

  • sourceLayout – The layout the source is in; it is read in, and left in, VK_IMAGE_LAYOUT_GENERAL.

inline void setSource(ComputeGraphElementPtr element, int slot = -1)

The image drawn: element itself, or what it passes through slot.

inline void setTarget(ComputeGraphElementPtr element, int slot = -1)

The image drawn onto, which this element then stands for.

inline const std::shared_ptr<GeneralComputation<ImageCompositePushConstants>> &draw() const

The compute element that draws, e.g. to name it.

enum class klartraum::CompositeMode : uint32_t

How ImageComposite combines the source with the target.

Values:

enumerator Replace

The source’s pixels replace the target’s.

enumerator Over

The source is blended over the target by its alpha.

enum class klartraum::CompositeFit : uint32_t

Where ImageComposite draws the source on the target.

Values:

enumerator Stretch

Over the whole target, aspect ratio not kept.

enumerator Fit

As large as fits whole, centred; the rest of the target stays.

enumerator Fill

As small as covers the target, centred; the source is cropped.

inline void klartraum::recordClearImage(VkCommandBuffer commandBuffer, VkImage image, const VkClearColorValue &color)

Records a clear of image to color and leaves it in VK_IMAGE_LAYOUT_GENERAL for whatever reads or writes it next.

The previous contents are discarded; the clear waits for all earlier work on the queue (e.g. the previous frame’s reads of a swapchain image).

class SinglePathImage : public klartraum::ImageViewSrc

One image that every path of a graph reads: a result computed once, e.g. by another graph, made available to a graph with several paths.

getImage() returns the same image for any path id. The image stays in VK_IMAGE_LAYOUT_GENERAL and is never cleared by the graph; elements of a graph must only read it. Its contents are replaced from outside the graph with copyFrom() while no graph that reads it is executing.

Public Functions

inline void copyFrom(VkImage source, VkImageLayout sourceLayout, VkExtent2D sourceExtent, VkQueue queue = VK_NULL_HANDLE)

Copies source (of the same extent and the swapchain’s format) into the image, waiting for the copy to finish.

Parameters:
  • source – The image to copy.

  • sourceLayout – The layout source is in; it is left in it.

  • sourceExtent – The extent of source; it must equal extent().

  • queue – The queue that copies (default: the graphics queue; see VulkanContext::submitImmediate()).

Throws:

std::invalid_argument – If the extents differ.

Synchronization and placeholders

class ImageViewSrcTransition : public klartraum::ComputeGraphElement

A compute graph element that performs image layout transitions for Vulkan images.

This class handles the transition of image layouts using VkImageMemoryBarrier. It’s designed to work with ImageViewSrc elements in a compute graph and records the necessary commands to transition an image from one layout to another.

Default transition is from VK_IMAGE_LAYOUT_GENERAL to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR.

class BufferToGraphicsBarrier : public klartraum::ComputeGraphElement

Orders an indirect draw after the compute work that wrote its buffers.

The graph only orders compute work after compute work (GeneralComputation emits compute-to-compute memory barriers between its own dispatches). An indirect draw that reads buffers written by compute shaders (sorted indices, indirect draw arguments) needs a buffer barrier whose destination is the indirect-draw and vertex-shader stages of the graphics pipeline. This element supplies it: placed between the compute elements that write the buffers and the RenderPass that draws, the graph schedules it in between.

class NoOp : public klartraum::ComputeGraphElement

NoOp (No Operation) element that passes inputs through unchanged.

This element performs no computation and simply passes its inputs through to its outputs. It’s useful for representing operations like ONNX Constant nodes that provide data without computation, or for debugging/testing purposes.

Public Functions

inline NoOp(VulkanContext &vulkanContext)

Construct a new NoOp element.

Parameters:

vulkanContext – The Vulkan context for this element

inline virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.