VTK
9.4.20250326
|
Internals of the vtkWebGPUComputePass. More...
#include <vtkWebGPUComputePassInternals.h>
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. | |
vtkWebGPUComputePassInternals * | NewInstance () 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 corresponds to a texture of this compute pass. | |
bool | CheckTextureViewIndex (int textureViewIndex, const std::string &callerFunctionName) |
Checks if a given index corresponds 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) | |
virtual vtkWebGPUConfiguration * | GetWGPUConfiguration () |
Get/set the device used by this compute pass (usually the device of the compute pipeline holding this compute pass) | |
vtkWeakPointer< vtkWebGPUComputePipeline > | GetAssociatedPipeline () |
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. | |
![]() | |
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. | |
vtkCommand * | GetCommand (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. | |
![]() | |
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 vtkWebGPUComputePassInternals * | New () |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkWebGPUComputePassInternals * | SafeDownCast (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 vtkObject * | New () |
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 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 vtkObjectBase * | New () |
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< vtkWebGPUComputePass > | ParentPass |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkWebGPUComputePassInternals ()=default | |
~vtkWebGPUComputePassInternals () override | |
![]() | |
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. | |
![]() | |
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 vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
std::string | ObjectName |
![]() | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
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.
Definition at line 30 of file vtkWebGPUComputePassInternals.h.
|
protecteddefault |
|
overrideprotected |
|
static |
|
static |
|
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.
|
static |
|
protectedvirtual |
vtkWebGPUComputePassInternals * vtkWebGPUComputePassInternals::NewInstance | ( | ) | const |
|
overridevirtual |
void vtkWebGPUComputePassInternals::SetParentPass | ( | vtkWeakPointer< vtkWebGPUComputePass > | parentPass | ) |
Sets the parent pass of this internals class.
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)
|
virtual |
Get/set the device used by this compute pass (usually the device of the compute pipeline holding this compute pass)
vtkWeakPointer< vtkWebGPUComputePipeline > vtkWebGPUComputePassInternals::GetAssociatedPipeline | ( | ) |
Get/set the compute pipeline to which this compute pass belongs to.
void vtkWebGPUComputePassInternals::SetAssociatedPipeline | ( | vtkWeakPointer< vtkWebGPUComputePipeline > | associatedPipeline | ) |
Get/set the compute pipeline to which this compute pass belongs to.
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.
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.
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.
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.
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.
void vtkWebGPUComputePassInternals::CreateShaderModule | ( | ) |
Compiles the shader source given into a WGPU shader module.
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.
|
static |
Creates the bind group layout of a given list of buffers (that must all belong to the same bind group)
std::vector< wgpu::BindGroupEntry > vtkWebGPUComputePassInternals::CreateBindGroupEntries | ( | const std::vector< vtkWebGPUComputeBuffer * > & | buffers | ) |
Creates the bind group entries given a list of buffers.
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.
bool vtkWebGPUComputePassInternals::CheckTextureIndex | ( | int | textureIndex, |
const std::string & | callerFunctionName | ||
) |
Checks if a given index corresponds to a texture of this compute pass.
Returns true if the texture index is valid, false if it's not.
bool vtkWebGPUComputePassInternals::CheckTextureViewIndex | ( | int | textureViewIndex, |
const std::string & | callerFunctionName | ||
) |
Checks if a given index corresponds to a texture texture view of this compute pass.
Returns true if the texture view index is valid, false if it's not.
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.
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]
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.
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.
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.
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.
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.
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.
void vtkWebGPUComputePassInternals::RecreateTexture | ( | int | textureIndex | ) |
Destroys and recreates the texture with the given index.
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
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.
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
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
void vtkWebGPUComputePassInternals::RecreateTextureBindGroup | ( | int | textureIndex | ) |
After recreating a wgpu::Buffer, the bind group entry (and the bind group) will need to be updated.
This
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.
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.
void vtkWebGPUComputePassInternals::CreateWebGPUComputePipeline | ( | ) |
Creates the compute pipeline that will be used to dispatch the compute shader.
wgpu::PipelineLayout vtkWebGPUComputePassInternals::CreateWebGPUComputePipelineLayout | ( | ) |
Creates the compute pipeline layout associated with the bind group layouts of this compute pass.
wgpu::CommandEncoder vtkWebGPUComputePassInternals::CreateCommandEncoder | ( | ) |
Creates and returns a command encoder.
wgpu::ComputePassEncoder vtkWebGPUComputePassInternals::CreateComputePassEncoder | ( | const wgpu::CommandEncoder & | commandEncoder | ) |
Creates a compute pass encoder from a command encoder.
void vtkWebGPUComputePassInternals::WebGPUDispatch | ( | unsigned int | groupsX, |
unsigned int | groupsY, | ||
unsigned int | groupsZ | ||
) |
Encodes the compute pass and dispatches the workgroups.
void vtkWebGPUComputePassInternals::SubmitCommandEncoderToQueue | ( | const wgpu::CommandEncoder & | commandEncoder | ) |
Finishes the encoding of a command encoder and submits the resulting command buffer to the queue.
void vtkWebGPUComputePassInternals::ReleaseResources | ( | ) |
Releases the resources of this compute pass internals.
|
friend |
Definition at line 312 of file vtkWebGPUComputePassInternals.h.
|
friend |
Definition at line 313 of file vtkWebGPUComputePassInternals.h.
|
friend |
Definition at line 314 of file vtkWebGPUComputePassInternals.h.
|
friend |
Definition at line 315 of file vtkWebGPUComputePassInternals.h.
|
friend |
Definition at line 317 of file vtkWebGPUComputePassInternals.h.
vtkWeakPointer<vtkWebGPUComputePass> vtkWebGPUComputePassInternals::ParentPass |
Definition at line 305 of file vtkWebGPUComputePassInternals.h.