Capítulo 379 de 859

Chapter 379: AtomicFunctionNode

Core Idea

AtomicFunctionNode represents any function that can operate on atomic variable types within a shader. In an atomic function, any modification to an atomic variable will occur as an indivisible step with a defined order relative to other modifications. Accordingly, even if multiple atomic functions are modifying an atomic variable at once atomic operations will not interfere with each other.

This node can only be used with a WebGPU backend.

Key Concepts

  • method : string: The signature of the atomic function to construct.
  • parents : boolean: Creates a list of the parents for this node for detecting if the node needs to return a value.
  • pointerNode : Node: An atomic variable or element of an atomic buffer.
  • valueNode : Node: A value that modifies the atomic variable.

Reference Tables

Constructor

Signature
new AtomicFunctionNode( method : string, pointerNode : Node, valueNode : Node )

Properties

PropertyDescription
.method : stringThe signature of the atomic function to construct.
.parents : booleanCreates a list of the parents for this node for detecting if the node needs to return a value.
.pointerNode : NodeAn atomic variable or element of an atomic buffer.
.valueNode : NodeA value that modifies the atomic variable.

Methods

MethodDescription
.generateNodeType( builder : NodeBuilder ) : stringOverwritten since the node type is inferred from the input type.
.getInputType( builder : NodeBuilder ) : stringOverwrites the default implementation to return the type of the pointer node.

Key Takeaways

  1. AtomicFunctionNode extends: EventDispatcher → Node
  2. Most relevant properties: method, parents, pointerNode, valueNode.
  3. Key methods: generateNodeType, getInputType.

Connects To