VTK  9.3.20240919
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
vtkWebGPUComputePassInternals Class Reference

Internals of the vtkWebGPUComputePass. More...

#include <vtkWebGPUComputePassInternals.h>

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

Public Types

typedef vtkObject Superclass
 

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.
 
vtkWebGPUComputePassInternalsNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void SetParentPass (vtkWeakPointer< vtkWebGPUComputePass > parentPass)
 Sets the parent pass of this internals class.
 
wgpu::BindGroupLayoutEntry CreateBindGroupLayoutEntry (uint32_t binding, vtkWebGPUComputeBuffer::BufferMode mode)
 Given a buffer, creates the associated bind group layout entry that will be used when creating the bind group layouts and returns it.
 
wgpu::BindGroupLayoutEntry CreateBindGroupLayoutEntry (uint32_t binding, vtkSmartPointer< vtkWebGPUComputeTexture > computeTexture, vtkSmartPointer< vtkWebGPUComputeTextureView > textureView)
 Given a texture and its view, creates the associated bind group layout entry and returns it.
 
wgpu::BindGroupLayoutEntry CreateBindGroupLayoutEntry (uint32_t binding, vtkSmartPointer< vtkWebGPUComputeTexture > computeTexture, wgpu::TextureViewDimension textureViewDimension)
 Overload mainly used for creating the layout entry of render textures where we don't have a vtkWebGPUComputeTextureView object and where the view is assumed to be very close in configuration to the texture so the mode of the texture is used for the texture view for example and returns it.
 
wgpu::BindGroupEntry CreateBindGroupEntry (wgpu::Buffer buffer, uint32_t binding, vtkWebGPUComputeBuffer::BufferMode mode, uint32_t offset)
 Given a buffer, creates the associated bind group entry that will be used when creating the bind groups and returns it.
 
wgpu::BindGroupEntry CreateBindGroupEntry (uint32_t binding, wgpu::TextureView textureView)
 Given a texture view, creates the associated bind group entry that will be used when creating the bind groups and returns it.
 
void CreateShaderModule ()
 Compiles the shader source given into a WGPU shader module.
 
void CreateBindGroupsAndLayouts ()
 Creates all the bind groups and bind group layouts of this compute pass from the buffers that have been added so far.
 
std::vector< wgpu::BindGroupEntry > CreateBindGroupEntries (const std::vector< vtkWebGPUComputeBuffer * > &buffers)
 Creates the bind group entries given a list of buffers.
 
bool CheckBufferIndex (int bufferIndex, const std::string &callerFunctionName)
 Checks if a given index is suitable for indexing Buffers.
 
bool CheckTextureIndex (int textureIndex, const std::string &callerFunctionName)
 Checks if a given index correponds to a texture of this compute pass.
 
bool CheckTextureViewIndex (int textureViewIndex, const std::string &callerFunctionName)
 Checks if a given index correponds to a texture texture view of this compute pass.
 
bool CheckBufferCorrectness (vtkSmartPointer< vtkWebGPUComputeBuffer > buffer)
 Returns true if the buffer is ready to be added to the compute pass or not.
 
void RecreateBufferBindGroup (int bufferIndex)
 Recreates the bind group and bind group entry of a buffer (given by its index)
 
void RegisterBufferToPipeline (vtkSmartPointer< vtkWebGPUComputeBuffer > buffer, wgpu::Buffer wgpuBuffer)
 Registers a buffer to the associated compute pipeline of this compute pass so that other compute passes of the same pipeline can reuse it.
 
wgpu::Buffer GetWGPUBuffer (std::size_t bufferIndex)
 Returns the wgpu::Buffer object for a buffer in this compute pass buffer storage given its index.
 
void RegisterTextureToPipeline (vtkSmartPointer< vtkWebGPUComputeTexture > texture, wgpu::Texture wgpuTexture)
 Registers a texture to the associated compute pipeline of this compute pass so that other compute passes of the same pipeline can reuse it.
 
void RecreateBuffer (int bufferIndex, vtkIdType newByteSize)
 Destroys and recreates a buffer with the given newByteSize Only the wgpu::Buffer object is recreated so the binding/group of the group doesn't change.
 
void RecreateTexture (int textureIndex)
 Destroys and recreates the texture with the given index.
 
void RecreateTextureViews (int textureIndex)
 Recreates all the texture views of a texture given its index.
 
wgpu::TextureView CreateWebGPUTextureView (vtkSmartPointer< vtkWebGPUComputeTextureView > textureView, wgpu::Texture wgpuTexture)
 Utilitary method to create a wgpu::TextureView from a ComputeTextureView and the texture this wgpu::TextureView is going to be a view off.
 
void UpdateWebGPUBuffer (vtkSmartPointer< vtkWebGPUComputeBuffer > buffer, wgpu::Buffer wgpuBuffer)
 Updates the wgpu::Buffer reference that a compute buffer is associated to.
 
void UpdateComputeTextureAndViews (vtkSmartPointer< vtkWebGPUComputeTexture > texture, wgpu::Texture newWgpuTexture)
 Makes sure that the compute texture given in parameter internally points to the given newWgpuTexture.
 
void RecreateTextureBindGroup (int textureIndex)
 After recreating a wgpu::Buffer, the bind group entry (and the bind group) will need to be updated.
 
void SetupRenderBuffer (vtkSmartPointer< vtkWebGPUComputeRenderBuffer > renderBuffer)
 Binds the buffer to the compute pass at the WebGPU level.
 
void RecreateRenderTexture (vtkSmartPointer< vtkWebGPUComputeRenderTexture > renderTexture)
 Recreates a render texture given a new textureView and possibly new parameters as specified in the 'renderTexture' parameter.
 
void CreateWebGPUComputePipeline ()
 Creates the compute pipeline that will be used to dispatch the compute shader.
 
wgpu::PipelineLayout CreateWebGPUComputePipelineLayout ()
 Creates the compute pipeline layout associated with the bind group layouts of this compute pass.
 
wgpu::CommandEncoder CreateCommandEncoder ()
 Creates and returns a command encoder.
 
wgpu::ComputePassEncoder CreateComputePassEncoder (const wgpu::CommandEncoder &commandEncoder)
 Creates a compute pass encoder from a command encoder.
 
void WebGPUDispatch (unsigned int groupsX, unsigned int groupsY, unsigned int groupsZ)
 Encodes the compute pass and dispatches the workgroups.
 
void SubmitCommandEncoderToQueue (const wgpu::CommandEncoder &commandEncoder)
 Finishes the encoding of a command encoder and submits the resulting command buffer to the queue.
 
void ReleaseResources ()
 Releases the resources of this compute pass internals.
 
void SetWGPUConfiguration (vtkWebGPUConfiguration *config)
 Get/set the device used by this compute pass (usually the device of the compute pipeline holding this compute pass)
 
 vtkGetSmartPointerMacro (WGPUConfiguration, vtkWebGPUConfiguration)
 Get/set the device used by this compute pass (usually the device of the compute pipeline holding this compute pass)
 
vtkWeakPointer< vtkWebGPUComputePipelineGetAssociatedPipeline ()
 Get/set the compute pipeline to which this compute pass belongs to.
 
void SetAssociatedPipeline (vtkWeakPointer< vtkWebGPUComputePipeline > associatedPipeline)
 Get/set the compute pipeline to which this compute pass belongs to.
 
bool GetRegisteredBufferFromPipeline (vtkSmartPointer< vtkWebGPUComputeBuffer > buffer, wgpu::Buffer &wgpuBuffer)
 Checks whether the given compute buffer/texture has already been registered in the pipeline associated to this compute pass.
 
bool GetRegisteredTextureFromPipeline (vtkSmartPointer< vtkWebGPUComputeTexture > texture, wgpu::Texture &wgpuTexture)
 Checks whether the given compute buffer/texture has already been registered in the pipeline associated to this compute pass.
 
- 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 vtkWebGPUComputePassInternalsNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkWebGPUComputePassInternalsSafeDownCast (vtkObjectBase *o)
 
static wgpu::BindGroupLayout CreateBindGroupLayout (const wgpu::Device &device, const std::vector< wgpu::BindGroupLayoutEntry > &layoutEntries)
 Creates the bind group layout of a given list of buffers (that must all belong to the same bind group)
 
- 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.
 

Public Attributes

vtkWeakPointer< vtkWebGPUComputePassParentPass
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkWebGPUComputePassInternals ()=default
 
 ~vtkWebGPUComputePassInternals () 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 vtkWebGPUComputePass
 
class vtkWebGPUComputePassBufferStorageInternals
 
class vtkWebGPUComputePassTextureStorageInternals
 
class vtkWebGPUComputePipeline
 
class vtkWebGPUPointCloudMapperInternals
 

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

Internals of the vtkWebGPUComputePass.

This class manages the creation/deletion/recreation of bind group and bind group layouts. This is also the class that maintains the state of a compute pass (Texture and Buffer storages)

Definition at line 26 of file vtkWebGPUComputePassInternals.h.

Member Typedef Documentation

◆ Superclass

Definition at line 30 of file vtkWebGPUComputePassInternals.h.

Constructor & Destructor Documentation

◆ vtkWebGPUComputePassInternals()

vtkWebGPUComputePassInternals::vtkWebGPUComputePassInternals ( )
protecteddefault

◆ ~vtkWebGPUComputePassInternals()

vtkWebGPUComputePassInternals::~vtkWebGPUComputePassInternals ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkWebGPUComputePassInternals * vtkWebGPUComputePassInternals::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

virtual vtkTypeBool vtkWebGPUComputePassInternals::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 vtkWebGPUComputePassInternals * vtkWebGPUComputePassInternals::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkWebGPUComputePassInternals::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkWebGPUComputePassInternals * vtkWebGPUComputePassInternals::NewInstance ( ) const

◆ PrintSelf()

void vtkWebGPUComputePassInternals::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.

◆ SetParentPass()

void vtkWebGPUComputePassInternals::SetParentPass ( vtkWeakPointer< vtkWebGPUComputePass parentPass)

Sets the parent pass of this internals class.

◆ SetWGPUConfiguration()

void vtkWebGPUComputePassInternals::SetWGPUConfiguration ( vtkWebGPUConfiguration config)

Get/set the device used by this compute pass (usually the device of the compute pipeline holding this compute pass)

◆ vtkGetSmartPointerMacro()

vtkWebGPUComputePassInternals::vtkGetSmartPointerMacro ( WGPUConfiguration  ,
vtkWebGPUConfiguration   
)

Get/set the device used by this compute pass (usually the device of the compute pipeline holding this compute pass)

◆ GetAssociatedPipeline()

vtkWeakPointer< vtkWebGPUComputePipeline > vtkWebGPUComputePassInternals::GetAssociatedPipeline ( )

Get/set the compute pipeline to which this compute pass belongs to.

◆ SetAssociatedPipeline()

void vtkWebGPUComputePassInternals::SetAssociatedPipeline ( vtkWeakPointer< vtkWebGPUComputePipeline associatedPipeline)

Get/set the compute pipeline to which this compute pass belongs to.

◆ CreateBindGroupLayoutEntry() [1/3]

wgpu::BindGroupLayoutEntry vtkWebGPUComputePassInternals::CreateBindGroupLayoutEntry ( uint32_t  binding,
vtkWebGPUComputeBuffer::BufferMode  mode 
)

Given a buffer, creates the associated bind group layout entry that will be used when creating the bind group layouts and returns it.

◆ CreateBindGroupLayoutEntry() [2/3]

wgpu::BindGroupLayoutEntry vtkWebGPUComputePassInternals::CreateBindGroupLayoutEntry ( uint32_t  binding,
vtkSmartPointer< vtkWebGPUComputeTexture computeTexture,
vtkSmartPointer< vtkWebGPUComputeTextureView textureView 
)

Given a texture and its view, creates the associated bind group layout entry and returns it.

◆ CreateBindGroupLayoutEntry() [3/3]

wgpu::BindGroupLayoutEntry vtkWebGPUComputePassInternals::CreateBindGroupLayoutEntry ( uint32_t  binding,
vtkSmartPointer< vtkWebGPUComputeTexture computeTexture,
wgpu::TextureViewDimension  textureViewDimension 
)

Overload mainly used for creating the layout entry of render textures where we don't have a vtkWebGPUComputeTextureView object and where the view is assumed to be very close in configuration to the texture so the mode of the texture is used for the texture view for example and returns it.

◆ CreateBindGroupEntry() [1/2]

wgpu::BindGroupEntry vtkWebGPUComputePassInternals::CreateBindGroupEntry ( wgpu::Buffer  buffer,
uint32_t  binding,
vtkWebGPUComputeBuffer::BufferMode  mode,
uint32_t  offset 
)

Given a buffer, creates the associated bind group entry that will be used when creating the bind groups and returns it.

◆ CreateBindGroupEntry() [2/2]

wgpu::BindGroupEntry vtkWebGPUComputePassInternals::CreateBindGroupEntry ( uint32_t  binding,
wgpu::TextureView  textureView 
)

Given a texture view, creates the associated bind group entry that will be used when creating the bind groups and returns it.

◆ CreateShaderModule()

void vtkWebGPUComputePassInternals::CreateShaderModule ( )

Compiles the shader source given into a WGPU shader module.

◆ CreateBindGroupsAndLayouts()

void vtkWebGPUComputePassInternals::CreateBindGroupsAndLayouts ( )

Creates all the bind groups and bind group layouts of this compute pass from the buffers that have been added so far.

◆ CreateBindGroupLayout()

static wgpu::BindGroupLayout vtkWebGPUComputePassInternals::CreateBindGroupLayout ( const wgpu::Device &  device,
const std::vector< wgpu::BindGroupLayoutEntry > &  layoutEntries 
)
static

Creates the bind group layout of a given list of buffers (that must all belong to the same bind group)

◆ CreateBindGroupEntries()

std::vector< wgpu::BindGroupEntry > vtkWebGPUComputePassInternals::CreateBindGroupEntries ( const std::vector< vtkWebGPUComputeBuffer * > &  buffers)

Creates the bind group entries given a list of buffers.

◆ CheckBufferIndex()

bool vtkWebGPUComputePassInternals::CheckBufferIndex ( int  bufferIndex,
const std::string &  callerFunctionName 
)

Checks if a given index is suitable for indexing Buffers.

Logs an error if the index is negative or greater than the number of buffer of the compute pass.

The callerFunctionName parameter is using to give more information on what function used an invalid buffer index

Returns true if the buffer index is valid, false if it's not.

◆ CheckTextureIndex()

bool vtkWebGPUComputePassInternals::CheckTextureIndex ( int  textureIndex,
const std::string &  callerFunctionName 
)

Checks if a given index correponds to a texture of this compute pass.

Returns true if the texture index is valid, false if it's not.

◆ CheckTextureViewIndex()

bool vtkWebGPUComputePassInternals::CheckTextureViewIndex ( int  textureViewIndex,
const std::string &  callerFunctionName 
)

Checks if a given index correponds to a texture texture view of this compute pass.

Returns true if the texture view index is valid, false if it's not.

◆ CheckBufferCorrectness()

bool vtkWebGPUComputePassInternals::CheckBufferCorrectness ( vtkSmartPointer< vtkWebGPUComputeBuffer buffer)

Returns true if the buffer is ready to be added to the compute pass or not.

Returns false otherwise.

◆ RecreateBufferBindGroup()

void vtkWebGPUComputePassInternals::RecreateBufferBindGroup ( int  bufferIndex)

Recreates the bind group and bind group entry of a buffer (given by its index)

The function is useful after recreating a wgpu::Buffer, the bind group entry (and the bind group) will need to be updated because the wgpu::Buffer object has changed. This function thus assumes that the new buffer can be found in WebGPUBuffers[bufferIndex]

◆ RegisterBufferToPipeline()

void vtkWebGPUComputePassInternals::RegisterBufferToPipeline ( vtkSmartPointer< vtkWebGPUComputeBuffer buffer,
wgpu::Buffer  wgpuBuffer 
)

Registers a buffer to the associated compute pipeline of this compute pass so that other compute passes of the same pipeline can reuse it.

◆ GetRegisteredBufferFromPipeline()

bool vtkWebGPUComputePassInternals::GetRegisteredBufferFromPipeline ( vtkSmartPointer< vtkWebGPUComputeBuffer buffer,
wgpu::Buffer &  wgpuBuffer 
)

Checks whether the given compute buffer/texture has already been registered in the pipeline associated to this compute pass.

If so, returns true and sets the parameter to the WebGPU object registered in this pipeline.

Returns false and leaves the parameter unchanged otherwise.

◆ GetRegisteredTextureFromPipeline()

bool vtkWebGPUComputePassInternals::GetRegisteredTextureFromPipeline ( vtkSmartPointer< vtkWebGPUComputeTexture texture,
wgpu::Texture &  wgpuTexture 
)

Checks whether the given compute buffer/texture has already been registered in the pipeline associated to this compute pass.

If so, returns true and sets the parameter to the WebGPU object registered in this pipeline.

Returns false and leaves the parameter unchanged otherwise.

◆ GetWGPUBuffer()

wgpu::Buffer vtkWebGPUComputePassInternals::GetWGPUBuffer ( std::size_t  bufferIndex)

Returns the wgpu::Buffer object for a buffer in this compute pass buffer storage given its index.

◆ RegisterTextureToPipeline()

void vtkWebGPUComputePassInternals::RegisterTextureToPipeline ( vtkSmartPointer< vtkWebGPUComputeTexture texture,
wgpu::Texture  wgpuTexture 
)

Registers a texture to the associated compute pipeline of this compute pass so that other compute passes of the same pipeline can reuse it.

◆ RecreateBuffer()

void vtkWebGPUComputePassInternals::RecreateBuffer ( int  bufferIndex,
vtkIdType  newByteSize 
)

Destroys and recreates a buffer with the given newByteSize Only the wgpu::Buffer object is recreated so the binding/group of the group doesn't change.

◆ RecreateTexture()

void vtkWebGPUComputePassInternals::RecreateTexture ( int  textureIndex)

Destroys and recreates the texture with the given index.

◆ RecreateTextureViews()

void vtkWebGPUComputePassInternals::RecreateTextureViews ( int  textureIndex)

Recreates all the texture views of a texture given its index.

Useful when a texture has been recreated, meaning that the wgpu::Texture of this compute pass has changed --> the texture view do not point to a correct texture anymore and need to be recreated

◆ CreateWebGPUTextureView()

wgpu::TextureView vtkWebGPUComputePassInternals::CreateWebGPUTextureView ( vtkSmartPointer< vtkWebGPUComputeTextureView textureView,
wgpu::Texture  wgpuTexture 
)

Utilitary method to create a wgpu::TextureView from a ComputeTextureView and the texture this wgpu::TextureView is going to be a view off.

◆ UpdateWebGPUBuffer()

void vtkWebGPUComputePassInternals::UpdateWebGPUBuffer ( vtkSmartPointer< vtkWebGPUComputeBuffer buffer,
wgpu::Buffer  wgpuBuffer 
)

Updates the wgpu::Buffer reference that a compute buffer is associated to.

Useful when a compute buffer has been recreated and the associated wgpu::Buffer needs to be updated with the newly created buffer

◆ UpdateComputeTextureAndViews()

void vtkWebGPUComputePassInternals::UpdateComputeTextureAndViews ( vtkSmartPointer< vtkWebGPUComputeTexture texture,
wgpu::Texture  newWgpuTexture 
)

Makes sure that the compute texture given in parameter internally points to the given newWgpuTexture.

If this is not initially the case, it will be true after the call to this function. Also, all texture views of this texture will now be views of the given newWgpuTexture

This is useful when recreating the compute texture from another compute pass: the compute pipeline will be responsible for calling on all its compute passes to make sure that if a compute pass was using the texture that was recreated, it now uses the recreated texture and not the old one

◆ RecreateTextureBindGroup()

void vtkWebGPUComputePassInternals::RecreateTextureBindGroup ( int  textureIndex)

After recreating a wgpu::Buffer, the bind group entry (and the bind group) will need to be updated.

This

◆ SetupRenderBuffer()

void vtkWebGPUComputePassInternals::SetupRenderBuffer ( vtkSmartPointer< vtkWebGPUComputeRenderBuffer renderBuffer)

Binds the buffer to the compute pass at the WebGPU level.

To use once the buffer has been properly set up.

◆ RecreateRenderTexture()

void vtkWebGPUComputePassInternals::RecreateRenderTexture ( vtkSmartPointer< vtkWebGPUComputeRenderTexture renderTexture)

Recreates a render texture given a new textureView and possibly new parameters as specified in the 'renderTexture' parameter.

This also recreates the texture views that were created on this render texture.

This function is mainly called after the render window has been resized and render textures have thus also been resized.

◆ CreateWebGPUComputePipeline()

void vtkWebGPUComputePassInternals::CreateWebGPUComputePipeline ( )

Creates the compute pipeline that will be used to dispatch the compute shader.

◆ CreateWebGPUComputePipelineLayout()

wgpu::PipelineLayout vtkWebGPUComputePassInternals::CreateWebGPUComputePipelineLayout ( )

Creates the compute pipeline layout associated with the bind group layouts of this compute pass.

Warning
: The bind group layouts must have been created by CreateBindGroups() prior to calling this function

◆ CreateCommandEncoder()

wgpu::CommandEncoder vtkWebGPUComputePassInternals::CreateCommandEncoder ( )

Creates and returns a command encoder.

◆ CreateComputePassEncoder()

wgpu::ComputePassEncoder vtkWebGPUComputePassInternals::CreateComputePassEncoder ( const wgpu::CommandEncoder &  commandEncoder)

Creates a compute pass encoder from a command encoder.

◆ WebGPUDispatch()

void vtkWebGPUComputePassInternals::WebGPUDispatch ( unsigned int  groupsX,
unsigned int  groupsY,
unsigned int  groupsZ 
)

Encodes the compute pass and dispatches the workgroups.

Warning
: The bind groups and the compute pipeline must have been created prior to calling this function

◆ SubmitCommandEncoderToQueue()

void vtkWebGPUComputePassInternals::SubmitCommandEncoderToQueue ( const wgpu::CommandEncoder &  commandEncoder)

Finishes the encoding of a command encoder and submits the resulting command buffer to the queue.

◆ ReleaseResources()

void vtkWebGPUComputePassInternals::ReleaseResources ( )

Releases the resources of this compute pass internals.

Friends And Related Symbol Documentation

◆ vtkWebGPUComputePass

friend class vtkWebGPUComputePass
friend

Definition at line 312 of file vtkWebGPUComputePassInternals.h.

◆ vtkWebGPUComputePassBufferStorageInternals

Definition at line 313 of file vtkWebGPUComputePassInternals.h.

◆ vtkWebGPUComputePassTextureStorageInternals

Definition at line 314 of file vtkWebGPUComputePassInternals.h.

◆ vtkWebGPUComputePipeline

friend class vtkWebGPUComputePipeline
friend

Definition at line 315 of file vtkWebGPUComputePassInternals.h.

◆ vtkWebGPUPointCloudMapperInternals

Definition at line 317 of file vtkWebGPUComputePassInternals.h.

Member Data Documentation

◆ ParentPass

vtkWeakPointer<vtkWebGPUComputePass> vtkWebGPUComputePassInternals::ParentPass

Definition at line 305 of file vtkWebGPUComputePassInternals.h.


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