Capítulo 516 de 859

Chapter 516: WorkgroupInfoNode

Core Idea

A node allowing the user to create a 'workgroup' scoped buffer within the context of a compute shader. Typically, workgroup scoped buffers are created to hold data that is transferred from a global storage scope into a local workgroup scope. For invocations within a workgroup, data access speeds on 'workgroup' scoped buffers can be significantly faster than similar access operations on globally accessible storage buffers.

This node can only be used with a WebGPU backend.

Key Concepts

  • bufferCount : number: The buffer count.
  • bufferType : string: The buffer type.
  • elementType : string: The data type of the array buffer.
  • isWorkgroupInfoNode : boolean (readonly): This flag can be used for type testing.
  • name : string: The name of the workgroup scoped buffer.
  • scope : string: TODO.

Reference Tables

Constructor

Signature
new WorkgroupInfoNode( scope : string, bufferType : string, bufferCount : number )

Properties

PropertyDescription
.bufferCount : numberThe buffer count.
.bufferType : stringThe buffer type.
.elementType : stringThe data type of the array buffer.
.isWorkgroupInfoNode : boolean (readonly)This flag can be used for type testing.
.name : stringThe name of the workgroup scoped buffer.
.scope : stringTODO.

Methods

MethodDescription
.element( indexNode : IndexNode ) : WorkgroupInfoElementNodeThis method can be used to access elements via an index node.
.getElementType() : stringThe data type of the array buffer.
.getInputType( builder : NodeBuilder ) : stringOverwrites the default implementation since the input type is inferred from the scope.
.label( name : string ) : WorkgroupInfoNodeSets the name/label of this node.
.setName( name : string ) : WorkgroupInfoNodeSets the name of this node.
.setScope( scope : string ) : WorkgroupInfoNodeSets the scope of this node.

Key Takeaways

  1. WorkgroupInfoNode extends: EventDispatcher → Node
  2. Most relevant properties: bufferCount, bufferType, elementType, isWorkgroupInfoNode.
  3. Key methods: element, getElementType, getInputType, label.

Connects To