VTK  9.4.20250208
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
vtkWebGPUComputePass Class Reference

A compute pass is an abstraction for offloading computation from the CPU onto the GPU using WebGPU compute shaders. More...

#include <vtkWebGPUComputePass.h>

Inheritance diagram for vtkWebGPUComputePass:
[legend]
Collaboration diagram for vtkWebGPUComputePass:
[legend]

Public Types

typedef vtkObject Superclass
 
using BufferMapAsyncCallback = std::function< void(const void *, void *)>
 
using TextureMapAsyncCallback = std::function< void(const void *, int, void *)>
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkWebGPUComputePassNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void SetShaderSourceFromPath (const char *shaderFilePath)
 
int AddBuffer (vtkSmartPointer< vtkWebGPUComputeBuffer > buffer)
 Adds a buffer to the pass and uploads its data to the device.
 
void AddRenderBuffer (vtkSmartPointer< vtkWebGPUComputeRenderBuffer > renderBuffer)
 Adds a render buffer to the pass.
 
int AddRenderTexture (vtkSmartPointer< vtkWebGPUComputeRenderTexture > renderTexture)
 Adds a render texture to the pass.
 
int AddTexture (vtkSmartPointer< vtkWebGPUComputeTexture > texture)
 Adds a texture to the pass and upload its data to the device.
 
vtkSmartPointer< vtkWebGPUComputeTextureViewCreateTextureView (int textureIndex)
 Returns a new texture view on the given texture (given by the index) that can be configured and then added to the compute pass by AddTextureView()
 
int AddTextureView (vtkSmartPointer< vtkWebGPUComputeTextureView > textureView)
 Adds a texture view to the compute pass and returns its index.
 
void RebindTextureView (int group, int binding, int textureViewIndex)
 This function allows the usage of multiple texture views on a single binding point (group / binding combination) in the shader (although not at the same time).
 
void DeleteTextureViews (int textureIndex)
 Deletes all the texture views of a given texture (given by its index)
 
unsigned int GetBufferByteSize (int bufferIndex)
 Returns the size in bytes of a buffer.
 
void ResizeBuffer (int bufferIndex, vtkIdType newByteSize)
 Resizes a buffer of the pass.
 
vtkSmartPointer< vtkWebGPUComputeTextureGetComputeTexture (int textureIndex)
 Retrieves the compute texture associated with the given texture index.
 
vtkSmartPointer< vtkWebGPUComputeTextureViewGetTextureView (int textureViewIndex)
 Retrieves the texture view associated with the given texture view index.
 
void RecreateComputeTexture (int textureIndex)
 Recreates a compute texture.
 
void RecreateTextureView (int textureViewIndex)
 Recreates a compute texture view.
 
void ReadBufferFromGPU (int bufferIndex, BufferMapAsyncCallback callback, void *userdata)
 
void ReadTextureFromGPU (int textureIndex, int mipLevel, TextureMapAsyncCallback callback, void *userdata)
 This function maps the texture into a linear memory block, making it accessible to the CPU.
 
template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true>
void UpdateBufferData (int bufferIndex, const std::vector< T > &newData)
 Updates the data of a buffer.
 
template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true>
void UpdateBufferData (int bufferIndex, vtkIdType byteOffset, const std::vector< T > &data)
 Similar to the overload without offset of this function.
 
void UpdateBufferData (int bufferIndex, vtkDataArray *newData)
 Updates the data of a buffer with a vtkDataArray.
 
void UpdateBufferData (int bufferIndex, vtkIdType byteOffset, vtkDataArray *newData)
 Similar to the overload without offset of this function.
 
template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true>
void UpdateTextureData (int textureIndex, const std::vector< T > &data)
 Uploads the given data to the texture starting at pixel (0, 0)
 
void Dispatch ()
 Dispatch the compute pass with (X, Y, Z) = (groupX, groupsY, groupZ) groups.
 
void ReleaseResources ()
 Releases the resources used by this compute pass.
 
virtual std::string GetShaderSource ()
 Set/get the WGSL source of the shader.
 
virtual void SetShaderSource (std::string)
 Set/get the WGSL source of the shader.
 
virtual std::string GetShaderEntryPoint ()
 Set/get the entry (name of the function) of the WGSL compute shader.
 
virtual void SetShaderEntryPoint (std::string)
 Set/get the entry (name of the function) of the WGSL compute shader.
 
virtual std::string & GetLabel ()
 Set/get the label of the compute pass.
 
void SetLabel (const std::string &label)
 Set/get the label of the compute pass.
 
void SetWorkgroups (int groupsX, int groupsY, int groupsZ)
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method.
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.
 

Static Public Member Functions

static vtkWebGPUComputePassNew ()
 Note to the VTK user: A compute pass should always be acquired through vtkWebGPUComputePipeline::CreateComputePass().
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkWebGPUComputePassSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkWebGPUComputePass ()
 
 ~vtkWebGPUComputePass () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Friends

class vtkWebGPUComputePassInternals
 
class vtkWebGPUComputePassTextureStorageInternals
 
class vtkWebGPUComputePassBufferStorageInternals
 
class vtkWebGPUComputePipeline
 
class vtkWebGPUHelpers
 
class vtkWebGPUPointCloudMapperInternals
 
class vtkWebGPURenderWindow
 
class vtkWebGPURenderer
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

A compute pass is an abstraction for offloading computation from the CPU onto the GPU using WebGPU compute shaders.

The basic usage of a compute pass outside a rendering pipeline is:

Integrated into a rendering pipeline, the only difference in the usage of the class is going to be the creation of the buffers. You will not create the vtkWebGPUComputeBuffer yourself but rather acquire one (or many) by calling AcquirePointAttributeComputeRenderBuffer() on a vtkWebGPURenderer. The returned buffers can then be added to the compute pass with AddRenderBuffer(). Other steps are identical. This remark also applies to render textures.

Definition at line 50 of file vtkWebGPUComputePass.h.

Member Typedef Documentation

◆ Superclass

Definition at line 59 of file vtkWebGPUComputePass.h.

◆ BufferMapAsyncCallback

using vtkWebGPUComputePass::BufferMapAsyncCallback = std::function<void(const void*, void*)>

Definition at line 202 of file vtkWebGPUComputePass.h.

◆ TextureMapAsyncCallback

using vtkWebGPUComputePass::TextureMapAsyncCallback = std::function<void(const void*, int, void*)>

Definition at line 233 of file vtkWebGPUComputePass.h.

Constructor & Destructor Documentation

◆ vtkWebGPUComputePass()

vtkWebGPUComputePass::vtkWebGPUComputePass ( )
protected

◆ ~vtkWebGPUComputePass()

vtkWebGPUComputePass::~vtkWebGPUComputePass ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkWebGPUComputePass * vtkWebGPUComputePass::New ( )
static

Note to the VTK user: A compute pass should always be acquired through vtkWebGPUComputePipeline::CreateComputePass().

You should not create compute pass through vtkNew<> or vtkSmartPointer<> directly.

◆ IsTypeOf()

static vtkTypeBool vtkWebGPUComputePass::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkWebGPUComputePass::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkWebGPUComputePass * vtkWebGPUComputePass::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkWebGPUComputePass::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkWebGPUComputePass * vtkWebGPUComputePass::NewInstance ( ) const

◆ PrintSelf()

void vtkWebGPUComputePass::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

◆ GetShaderSource()

virtual std::string vtkWebGPUComputePass::GetShaderSource ( )
virtual

Set/get the WGSL source of the shader.

◆ SetShaderSource()

virtual void vtkWebGPUComputePass::SetShaderSource ( std::string  )
virtual

Set/get the WGSL source of the shader.

◆ SetShaderSourceFromPath()

void vtkWebGPUComputePass::SetShaderSourceFromPath ( const char *  shaderFilePath)

◆ GetShaderEntryPoint()

virtual std::string vtkWebGPUComputePass::GetShaderEntryPoint ( )
virtual

Set/get the entry (name of the function) of the WGSL compute shader.

◆ SetShaderEntryPoint()

virtual void vtkWebGPUComputePass::SetShaderEntryPoint ( std::string  )
virtual

Set/get the entry (name of the function) of the WGSL compute shader.

◆ GetLabel()

virtual std::string & vtkWebGPUComputePass::GetLabel ( )
virtual

Set/get the label of the compute pass.

This label will be printed along with error/warning logs to help with debugging

◆ SetLabel()

void vtkWebGPUComputePass::SetLabel ( const std::string &  label)

Set/get the label of the compute pass.

This label will be printed along with error/warning logs to help with debugging

◆ AddBuffer()

int vtkWebGPUComputePass::AddBuffer ( vtkSmartPointer< vtkWebGPUComputeBuffer buffer)

Adds a buffer to the pass and uploads its data to the device.

Returns the index of the buffer that can for example be used as input to the ReadBufferFromGPU() function

◆ AddRenderBuffer()

void vtkWebGPUComputePass::AddRenderBuffer ( vtkSmartPointer< vtkWebGPUComputeRenderBuffer renderBuffer)

Adds a render buffer to the pass.

A render buffer can be obtained from vtkWebGPURenderWindow::AcquireDepthBufferRenderTexture()

◆ AddRenderTexture()

int vtkWebGPUComputePass::AddRenderTexture ( vtkSmartPointer< vtkWebGPUComputeRenderTexture renderTexture)

Adds a render texture to the pass.

A render texture can be obtained from vtkWebGPURenderWindow::AcquireDepthBufferRenderTexture() and analogous methods.

◆ AddTexture()

int vtkWebGPUComputePass::AddTexture ( vtkSmartPointer< vtkWebGPUComputeTexture texture)

Adds a texture to the pass and upload its data to the device.

Returns the index of the texture that can for example be used as input to the ReadTextureFromGPU() function

◆ CreateTextureView()

vtkSmartPointer< vtkWebGPUComputeTextureView > vtkWebGPUComputePass::CreateTextureView ( int  textureIndex)

Returns a new texture view on the given texture (given by the index) that can be configured and then added to the compute pass by AddTextureView()

◆ AddTextureView()

int vtkWebGPUComputePass::AddTextureView ( vtkSmartPointer< vtkWebGPUComputeTextureView textureView)

Adds a texture view to the compute pass and returns its index.

◆ RebindTextureView()

void vtkWebGPUComputePass::RebindTextureView ( int  group,
int  binding,
int  textureViewIndex 
)

This function allows the usage of multiple texture views on a single binding point (group / binding combination) in the shader (although not at the same time).

It acts as AddTextureView() if no texture view was bound to the group/binding in the first place.

For example, consider that your shader has the following binding: @group(0) @binding(0) var inputTexture: texture_2d<f32>;

Depending on your needs, you may want to execute this compute pass twice but with a different texture as input to the shader each time. To achieve that, you would create 2 TextureViews on the 2 Textures that you want your shader to manipulate and call RebindTextureView() on your second texture view index before Dispatching the second compute pass so that it the texture view sampled in the shader samples the second texture.

◆ DeleteTextureViews()

void vtkWebGPUComputePass::DeleteTextureViews ( int  textureIndex)

Deletes all the texture views of a given texture (given by its index)

◆ GetBufferByteSize()

unsigned int vtkWebGPUComputePass::GetBufferByteSize ( int  bufferIndex)

Returns the size in bytes of a buffer.

◆ ResizeBuffer()

void vtkWebGPUComputePass::ResizeBuffer ( int  bufferIndex,
vtkIdType  newByteSize 
)

Resizes a buffer of the pass.

Warning
: After the resize, the data of the buffer is undefined and should be updated by a call to UpdateBufferData()

◆ GetComputeTexture()

vtkSmartPointer< vtkWebGPUComputeTexture > vtkWebGPUComputePass::GetComputeTexture ( int  textureIndex)

Retrieves the compute texture associated with the given texture index.

Warning
The texture will need to be recreated by calling RecreateComputeTexture() for all the changes done to this compute texture to take effect

◆ GetTextureView()

vtkSmartPointer< vtkWebGPUComputeTextureView > vtkWebGPUComputePass::GetTextureView ( int  textureViewIndex)

Retrieves the texture view associated with the given texture view index.

Warning
The texture view will need to be recreated by calling RecreateTextureView() for all the changes done to this texture view to take effect

◆ RecreateComputeTexture()

void vtkWebGPUComputePass::RecreateComputeTexture ( int  textureIndex)

Recreates a compute texture.

Must be called if the compute texture has been modified (after a call to GetComputeTexure() + modifications of the parameters for example) for the changes to take effect.

◆ RecreateTextureView()

void vtkWebGPUComputePass::RecreateTextureView ( int  textureViewIndex)

Recreates a compute texture view.

Must be called if the texture view has been modified (after a call to GetComputeTextureView for example) for the changes to take effect.

◆ ReadBufferFromGPU()

void vtkWebGPUComputePass::ReadBufferFromGPU ( int  bufferIndex,
BufferMapAsyncCallback  callback,
void *  userdata 
)

◆ ReadTextureFromGPU()

void vtkWebGPUComputePass::ReadTextureFromGPU ( int  textureIndex,
int  mipLevel,
TextureMapAsyncCallback  callback,
void *  userdata 
)

This function maps the texture into a linear memory block, making it accessible to the CPU.

This is an asynchronous operation, meaning that the given callback will be called when the mapping is done.

The texture data can then be read from the callback and stored in a buffer (std::vector<>, vtkDataArray, ...) passed in via the userdata pointer for example

◆ UpdateBufferData() [1/4]

template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true>
void vtkWebGPUComputePass::UpdateBufferData ( int  bufferIndex,
const std::vector< T > &  newData 
)
inline

Updates the data of a buffer.

The given data is expected to be at most the size of the buffer. If N bytes are given to update but the buffer size is > N, only the first N bytes will be updated, the rest will remain unchanged. The data is immediately available to the GPU (no call to vtkWebGPUComputePass::Update() is necessary for this call to take effect)

Note
: This method can be used even if the buffer was initially configured with std::vector data and the given data can safely be destroyed directly after calling this function.

Definition at line 260 of file vtkWebGPUComputePass.h.

◆ UpdateBufferData() [2/4]

template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true>
void vtkWebGPUComputePass::UpdateBufferData ( int  bufferIndex,
vtkIdType  byteOffset,
const std::vector< T > &  data 
)
inline

Similar to the overload without offset of this function.

The offset is used to determine where in the buffer to reupload data. Useful when only a portion of the buffer needs to be reuploaded.

Definition at line 271 of file vtkWebGPUComputePass.h.

◆ UpdateBufferData() [3/4]

void vtkWebGPUComputePass::UpdateBufferData ( int  bufferIndex,
vtkDataArray newData 
)

Updates the data of a buffer with a vtkDataArray.

The given data is expected to be at most the size of the buffer. If N bytes are given to update but the buffer size is > N, only the first N bytes will be updated, the rest will remain unchanged. The data is immediately available to the GPU (no call to vtkWebGPUComputePass::Update() is necessary for this call to take effect

Note
: This method can be used even if the buffer was initially configured with std::vector data and the given data can safely be destroyed directly after calling this function.

◆ UpdateBufferData() [4/4]

void vtkWebGPUComputePass::UpdateBufferData ( int  bufferIndex,
vtkIdType  byteOffset,
vtkDataArray newData 
)

Similar to the overload without offset of this function.

The offset is used to determine where in the buffer to reupload data. Useful when only a portion of the buffer needs to be reuploaded.

◆ UpdateTextureData()

template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true>
void vtkWebGPUComputePass::UpdateTextureData ( int  textureIndex,
const std::vector< T > &  data 
)
inline

Uploads the given data to the texture starting at pixel (0, 0)

Definition at line 300 of file vtkWebGPUComputePass.h.

◆ SetWorkgroups()

void vtkWebGPUComputePass::SetWorkgroups ( int  groupsX,
int  groupsY,
int  groupsZ 
)

◆ Dispatch()

void vtkWebGPUComputePass::Dispatch ( )

Dispatch the compute pass with (X, Y, Z) = (groupX, groupsY, groupZ) groups.

◆ ReleaseResources()

void vtkWebGPUComputePass::ReleaseResources ( )

Releases the resources used by this compute pass.

After this call, the compute pass will be in an unusable state and it should be removed from the compute pipeline it belongs to. A new compute pass should then be created from the compute pipeline.

Friends And Related Symbol Documentation

◆ vtkWebGPUComputePassInternals

friend class vtkWebGPUComputePassInternals
friend

Definition at line 337 of file vtkWebGPUComputePass.h.

◆ vtkWebGPUComputePassTextureStorageInternals

Definition at line 338 of file vtkWebGPUComputePass.h.

◆ vtkWebGPUComputePassBufferStorageInternals

Definition at line 339 of file vtkWebGPUComputePass.h.

◆ vtkWebGPUComputePipeline

friend class vtkWebGPUComputePipeline
friend

Definition at line 340 of file vtkWebGPUComputePass.h.

◆ vtkWebGPUHelpers

friend class vtkWebGPUHelpers
friend

Definition at line 341 of file vtkWebGPUComputePass.h.

◆ vtkWebGPUPointCloudMapperInternals

Definition at line 344 of file vtkWebGPUComputePass.h.

◆ vtkWebGPURenderWindow

friend class vtkWebGPURenderWindow
friend

Definition at line 345 of file vtkWebGPUComputePass.h.

◆ vtkWebGPURenderer

friend class vtkWebGPURenderer
friend

Definition at line 346 of file vtkWebGPUComputePass.h.


The documentation for this class was generated from the following file: