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

This class manages the creation/deletion/recreation/ of compute textures used by a compute pass. More...

#include <vtkWebGPUComputePassTextureStorageInternals.h>

Inheritance diagram for vtkWebGPUComputePassTextureStorageInternals:
[legend]
Collaboration diagram for vtkWebGPUComputePassTextureStorageInternals:
[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.
 
vtkWebGPUComputePassTextureStorageInternalsNewInstance () const
 
 vtkSetSmartPointerMacro (ParentPassWGPUConfiguration, vtkWebGPUConfiguration)
 Sets the device that will be used by this texture storage when creating textures / texture views.
 
void SetComputePass (vtkWeakPointer< vtkWebGPUComputePass > parentComputePass)
 Sets the compute pass that uses the textures and texture views used by this storage.
 
bool CheckTextureIndex (std::size_t textureIndex, const std::string &callerFunctionName)
 Checks if a given index is suitable for indexing this->Textures.
 
bool CheckTextureViewIndex (std::size_t textureViewIndex, const std::string &callerFunctionName)
 Checks if a given index is suitable for indexing this->TextureViews.
 
bool CheckTextureCorrectness (vtkWebGPUComputeTexture *texture)
 Makes sure the texture is correct with regards to its properties (size, ...)
 
bool CheckTextureViewCorrectness (vtkWebGPUComputeTextureView *textureView)
 Makes sure the texture view is correct with regards to its properties (binding, group, ...)
 
bool CheckParentComputePass (const std::string &callerFunctionName)
 Checks whether or not the associated ParentComputePass and ParentPassDevice are non-null.
 
void RecreateTexture (std::size_t textureIndex)
 Destroys and recreates the texture with the given index.
 
vtkSmartPointer< vtkWebGPUComputeTextureGetComputeTexture (std::size_t textureIndex)
 Retrieves the compute texture associated with the given texture index.
 
vtkSmartPointer< vtkWebGPUComputeTextureViewGetTextureView (std::size_t textureViewIndex)
 Retrieves the texture view associated with the given texture view index.
 
void RecreateComputeTexture (std::size_t textureIndex)
 Recreates a compute texture.
 
void RecreateTextureViews (std::size_t textureIndex)
 Recreates all the texture views of a texture given its index.
 
void RecreateTextureView (std::size_t textureViewIndex)
 Recreates a compute texture view.
 
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 UpdateComputeTextureAndViews (vtkSmartPointer< vtkWebGPUComputeTexture > texture, wgpu::Texture newWgpuTexture)
 Makes sure that the compute texture given in parameter internally points to the given newWgpuTexture.
 
int AddRenderTexture (vtkSmartPointer< vtkWebGPUComputeRenderTexture > renderTexture)
 Adds a render texture to the storage.
 
int AddTexture (vtkSmartPointer< vtkWebGPUComputeTexture > texture)
 Adds a texture to the storage and upload its data to the device.
 
int AddTextureView (vtkSmartPointer< vtkWebGPUComputeTextureView > textureView)
 Adds a texture view to the compute pass and returns its index.
 
vtkSmartPointer< vtkWebGPUComputeTextureViewCreateTextureView (std::size_t 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()
 
void RecreateRenderTexture (vtkSmartPointer< vtkWebGPUComputeRenderTexture > renderTexture)
 Recreates a render texture given a new textureView and possibly new parameters as specified in the 'renderTexture' parameter.
 
void DeleteTextureViews (std::size_t textureIndex)
 Deletes all the texture views of a given texture (given by its index)
 
void RebindTextureView (std::size_t group, uint32_t binding, std::size_t 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 ReadTextureFromGPU (std::size_t textureIndex, int mipLevel, vtkWebGPUComputePass::TextureMapAsyncCallback callback, void *userdata)
 
void WriteTexture (std::size_t textureIndex, const void *bytes, std::size_t numBytes)
 Uploads the given data to the texture starting at pixel (0, 0)
 
void ReleaseResources ()
 Releases the textures & resources held by this texture storage.
 
- 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 vtkWebGPUComputePassTextureStorageInternalsNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkWebGPUComputePassTextureStorageInternalsSafeDownCast (vtkObjectBase *o)
 
static wgpu::TextureDimension ComputeTextureDimensionToWebGPU (vtkWebGPUComputeTexture::TextureDimension dimension)
 Internal method used to convert the user friendly Dimension enum to its wgpu::TextureDimension equivalent.
 
static wgpu::TextureViewDimension ComputeTextureDimensionToViewDimension (vtkWebGPUComputeTexture::TextureDimension dimension)
 This function does a simple mapping between the dimension of the texture (vtkWebGPUComputeTexture::TextureDimension) and that of the texture view (wgpu::TextureViewDimension).
 
static wgpu::TextureFormat ComputeTextureFormatToWebGPU (vtkWebGPUComputeTexture::TextureFormat format)
 Internal method used to convert the user friendly TextureFormat enum to its wgpu::TextureFormat equivalent.
 
static wgpu::TextureUsage ComputeTextureModeToUsage (vtkWebGPUComputeTexture::TextureMode mode, const std::string &textureLabel)
 Internal method used to convert the user friendly TextureMode enum to its wgpu::TextureUsage equivalent.
 
static wgpu::StorageTextureAccess ComputeTextureModeToShaderStorage (vtkWebGPUComputeTexture::TextureMode mode, const std::string &textureLabel)
 Internal method used to get the StorageTextureAccess mode associated with a TextureMode.
 
static wgpu::StorageTextureAccess ComputeTextureViewModeToShaderStorage (vtkWebGPUComputeTextureView::TextureViewMode mode, const std::string &textureViewLabel)
 Internal method used to get the StorageTextureAccess mode associated with a TextureViewMode.
 
static wgpu::TextureSampleType ComputeTextureSampleTypeToWebGPU (vtkWebGPUComputeTexture::TextureSampleType sampleType)
 Internal method used to convert the user friendly TextureSampleType enum to its wgpu::TextureSampleType equivalent.
 
static wgpu::TextureAspect ComputeTextureViewAspectToWebGPU (vtkWebGPUComputeTextureView::TextureViewAspect aspect)
 Internal method used to convert the user friendly TextureAspect enum to its wgpu::TextureAspect equivalent.
 
- 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
 
 vtkWebGPUComputePassTextureStorageInternals ()=default
 
 ~vtkWebGPUComputePassTextureStorageInternals () 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
 

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

This class manages the creation/deletion/recreation/ of compute textures used by a compute pass.

A compute pass delegates calls that want to modify textures to this class.

Definition at line 31 of file vtkWebGPUComputePassTextureStorageInternals.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkWebGPUComputePassTextureStorageInternals()

vtkWebGPUComputePassTextureStorageInternals::vtkWebGPUComputePassTextureStorageInternals ( )
protecteddefault

◆ ~vtkWebGPUComputePassTextureStorageInternals()

vtkWebGPUComputePassTextureStorageInternals::~vtkWebGPUComputePassTextureStorageInternals ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkWebGPUComputePassTextureStorageInternals * vtkWebGPUComputePassTextureStorageInternals::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkWebGPUComputePassTextureStorageInternals::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkWebGPUComputePassTextureStorageInternals * vtkWebGPUComputePassTextureStorageInternals::NewInstance ( ) const

◆ vtkSetSmartPointerMacro()

vtkWebGPUComputePassTextureStorageInternals::vtkSetSmartPointerMacro ( ParentPassWGPUConfiguration  ,
vtkWebGPUConfiguration   
)

Sets the device that will be used by this texture storage when creating textures / texture views.

This device must be the one used by the parent compute pass.

◆ SetComputePass()

void vtkWebGPUComputePassTextureStorageInternals::SetComputePass ( vtkWeakPointer< vtkWebGPUComputePass parentComputePass)

Sets the compute pass that uses the textures and texture views used by this storage.

◆ CheckTextureIndex()

bool vtkWebGPUComputePassTextureStorageInternals::CheckTextureIndex ( std::size_t  textureIndex,
const std::string &  callerFunctionName 
)

Checks if a given index is suitable for indexing this->Textures.

Logs an error if the index is negative or greater than the number of texture of the compute pass. The callerFunctionName parameter is using to give more information on what function used an invalid texture index

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

◆ CheckTextureViewIndex()

bool vtkWebGPUComputePassTextureStorageInternals::CheckTextureViewIndex ( std::size_t  textureViewIndex,
const std::string &  callerFunctionName 
)

Checks if a given index is suitable for indexing this->TextureViews.

Logs an error if the index is negative or greater than the number of texture views of the compute pass. The callerFunctionName parameter is using to give more information on what function used an invalid texture view index

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

◆ CheckTextureCorrectness()

bool vtkWebGPUComputePassTextureStorageInternals::CheckTextureCorrectness ( vtkWebGPUComputeTexture texture)

Makes sure the texture is correct with regards to its properties (size, ...)

◆ CheckTextureViewCorrectness()

bool vtkWebGPUComputePassTextureStorageInternals::CheckTextureViewCorrectness ( vtkWebGPUComputeTextureView textureView)

Makes sure the texture view is correct with regards to its properties (binding, group, ...)

◆ CheckParentComputePass()

bool vtkWebGPUComputePassTextureStorageInternals::CheckParentComputePass ( const std::string &  callerFunctionName)

Checks whether or not the associated ParentComputePass and ParentPassDevice are non-null.

◆ RecreateTexture()

void vtkWebGPUComputePassTextureStorageInternals::RecreateTexture ( std::size_t  textureIndex)

Destroys and recreates the texture with the given index.

◆ GetComputeTexture()

vtkSmartPointer< vtkWebGPUComputeTexture > vtkWebGPUComputePassTextureStorageInternals::GetComputeTexture ( std::size_t  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 > vtkWebGPUComputePassTextureStorageInternals::GetTextureView ( std::size_t  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 vtkWebGPUComputePassTextureStorageInternals::RecreateComputeTexture ( std::size_t  textureIndex)

Recreates a compute texture.

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

This function also recreate the texture views that existed on the texture.

◆ RecreateTextureViews()

void vtkWebGPUComputePassTextureStorageInternals::RecreateTextureViews ( std::size_t  textureIndex)

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

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

◆ RecreateTextureView()

void vtkWebGPUComputePassTextureStorageInternals::RecreateTextureView ( std::size_t  textureViewIndex)

Recreates a compute texture view.

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

◆ CreateWebGPUTextureView()

wgpu::TextureView vtkWebGPUComputePassTextureStorageInternals::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.

◆ UpdateComputeTextureAndViews()

void vtkWebGPUComputePassTextureStorageInternals::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 (which will call the texture storages) 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

◆ AddRenderTexture()

int vtkWebGPUComputePassTextureStorageInternals::AddRenderTexture ( vtkSmartPointer< vtkWebGPUComputeRenderTexture renderTexture)

Adds a render texture to the storage.

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

The main difference in terms of implementation between this method and AddTexture() is that AddRenderTexture() does not create a wgpu::Texture object since the render texture already contains the texture object (configured when AcquireXXXRenderTexture() was called).

◆ AddTexture()

int vtkWebGPUComputePassTextureStorageInternals::AddTexture ( vtkSmartPointer< vtkWebGPUComputeTexture texture)

Adds a texture to the storage 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

◆ AddTextureView()

int vtkWebGPUComputePassTextureStorageInternals::AddTextureView ( vtkSmartPointer< vtkWebGPUComputeTextureView textureView)

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

◆ CreateTextureView()

vtkSmartPointer< vtkWebGPUComputeTextureView > vtkWebGPUComputePassTextureStorageInternals::CreateTextureView ( std::size_t  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()

◆ RecreateRenderTexture()

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

◆ DeleteTextureViews()

void vtkWebGPUComputePassTextureStorageInternals::DeleteTextureViews ( std::size_t  textureIndex)

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

◆ RebindTextureView()

void vtkWebGPUComputePassTextureStorageInternals::RebindTextureView ( std::size_t  group,
uint32_t  binding,
std::size_t  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 a 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 the shader samples the second texture (through the second texture view that has been rebound thanks to this function).

◆ ReadTextureFromGPU()

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

◆ WriteTexture()

void vtkWebGPUComputePassTextureStorageInternals::WriteTexture ( std::size_t  textureIndex,
const void *  bytes,
std::size_t  numBytes 
)
inline

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

Definition at line 225 of file vtkWebGPUComputePassTextureStorageInternals.h.

◆ ReleaseResources()

void vtkWebGPUComputePassTextureStorageInternals::ReleaseResources ( )

Releases the textures & resources held by this texture storage.

◆ ComputeTextureDimensionToWebGPU()

static wgpu::TextureDimension vtkWebGPUComputePassTextureStorageInternals::ComputeTextureDimensionToWebGPU ( vtkWebGPUComputeTexture::TextureDimension  dimension)
static

Internal method used to convert the user friendly Dimension enum to its wgpu::TextureDimension equivalent.

◆ ComputeTextureDimensionToViewDimension()

static wgpu::TextureViewDimension vtkWebGPUComputePassTextureStorageInternals::ComputeTextureDimensionToViewDimension ( vtkWebGPUComputeTexture::TextureDimension  dimension)
static

This function does a simple mapping between the dimension of the texture (vtkWebGPUComputeTexture::TextureDimension) and that of the texture view (wgpu::TextureViewDimension).

The API currently assumes that the view created on a texture is unique and completely matches the texture in terms of X, Y and Z sizes. This means that the texture view has the same extents and the same dimension.

◆ ComputeTextureFormatToWebGPU()

static wgpu::TextureFormat vtkWebGPUComputePassTextureStorageInternals::ComputeTextureFormatToWebGPU ( vtkWebGPUComputeTexture::TextureFormat  format)
static

Internal method used to convert the user friendly TextureFormat enum to its wgpu::TextureFormat equivalent.

◆ ComputeTextureModeToUsage()

static wgpu::TextureUsage vtkWebGPUComputePassTextureStorageInternals::ComputeTextureModeToUsage ( vtkWebGPUComputeTexture::TextureMode  mode,
const std::string &  textureLabel 
)
static

Internal method used to convert the user friendly TextureMode enum to its wgpu::TextureUsage equivalent.

The texture label parameter is used for error logging.

◆ ComputeTextureModeToShaderStorage()

static wgpu::StorageTextureAccess vtkWebGPUComputePassTextureStorageInternals::ComputeTextureModeToShaderStorage ( vtkWebGPUComputeTexture::TextureMode  mode,
const std::string &  textureLabel 
)
static

Internal method used to get the StorageTextureAccess mode associated with a TextureMode.

The texture label parameter is used for error logging.

◆ ComputeTextureViewModeToShaderStorage()

static wgpu::StorageTextureAccess vtkWebGPUComputePassTextureStorageInternals::ComputeTextureViewModeToShaderStorage ( vtkWebGPUComputeTextureView::TextureViewMode  mode,
const std::string &  textureViewLabel 
)
static

Internal method used to get the StorageTextureAccess mode associated with a TextureViewMode.

The texture view label parameter is used for error logging.

◆ ComputeTextureSampleTypeToWebGPU()

static wgpu::TextureSampleType vtkWebGPUComputePassTextureStorageInternals::ComputeTextureSampleTypeToWebGPU ( vtkWebGPUComputeTexture::TextureSampleType  sampleType)
static

Internal method used to convert the user friendly TextureSampleType enum to its wgpu::TextureSampleType equivalent.

◆ ComputeTextureViewAspectToWebGPU()

static wgpu::TextureAspect vtkWebGPUComputePassTextureStorageInternals::ComputeTextureViewAspectToWebGPU ( vtkWebGPUComputeTextureView::TextureViewAspect  aspect)
static

Internal method used to convert the user friendly TextureAspect enum to its wgpu::TextureAspect equivalent.

Friends And Related Symbol Documentation

◆ vtkWebGPUComputePassInternals

friend class vtkWebGPUComputePassInternals
friend

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