4 #ifndef vtkWebGPUComputePass_h
5 #define vtkWebGPUComputePass_h
9 #include "vtkRenderingWebGPUModule.h"
13 #include <type_traits>
26 VTK_ABI_NAMESPACE_BEGIN
71 void SetShaderSourceFromPath(
const char* shaderFilePath);
144 void RebindTextureView(
int group,
int binding,
int textureViewIndex);
149 void DeleteTextureViews(
int textureIndex);
154 unsigned int GetBufferByteSize(
int bufferIndex);
162 void ResizeBuffer(
int bufferIndex,
vtkIdType newByteSize);
185 void RecreateComputeTexture(
int textureIndex);
191 void RecreateTextureView(
int textureViewIndex);
244 void ReadTextureFromGPU(
262 this->WriteBufferData(bufferIndex, 0, newData.data(), newData.size() *
sizeof(T));
273 this->WriteBufferData(bufferIndex, byteOffset, data.data(), data.size() *
sizeof(T));
287 void UpdateBufferData(
int bufferIndex,
vtkDataArray* newData);
302 this->WriteTextureData(textureIndex, data.data(), data.size() *
sizeof(T));
309 void SetWorkgroups(
int groupsX,
int groupsY,
int groupsZ);
322 void ReleaseResources();
332 void WriteBufferData(
333 int bufferIndex,
vtkIdType byteOffset,
const void*
data, std::size_t numBytes);
335 void WriteTextureData(
int textureIndex,
const void*
data, std::size_t numBytes);
352 unsigned int GroupsX = 0, GroupsY = 0, GroupsZ = 0;
358 std::string WGPUCommandEncoderLabel =
"WebGPU command encoder \"" + this->Label +
"\"";
359 std::string WGPUComputePipelineLabel =
"WebGPU pipeline \"" + this->Label +
"\"";
365 VTK_ABI_NAMESPACE_END
Internals of the vtkWebGPUComputePass.
std::function< void(const void *, int, void *)> TextureMapAsyncCallback
void UpdateTextureData(int textureIndex, const std::vector< T > &data)
Uploads the given data to the texture starting at pixel (0, 0)
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Render textures are returned by calls to vtkWebGPUPolyDataMapper::AcquireXXXXRenderTexture() and repr...
Represents the set of parameters that will be used to create a compute shader buffer on the device wh...
Internal implementation details of vtkWebGPUPointCloudMapper.
a simple class to control print indentation
void UpdateBufferData(int bufferIndex, const std::vector< T > &newData)
Updates the data of a buffer.
abstract superclass for arrays of numeric data
void UpdateBufferData(int bufferIndex, vtkIdType byteOffset, const std::vector< T > &data)
Similar to the overload without offset of this function.
This class manages the creation/deletion/recreation/resizing/updating of compute buffers used by a co...
Render buffers are returned by calls to vtkWebGPUPolyDataMapper::AcquirePointAttributeComputeRenderBu...
Represents the set of parameters that will be used to create a compute shader texture on the device w...
A compute pipeline is the orchestrator of a collection of compute passes.
This class manages the creation/deletion/recreation/ of compute textures used by a compute pass...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
std::function< void(const void *, void *)> BufferMapAsyncCallback
A compute pass is an abstraction for offloading computation from the CPU onto the GPU using WebGPU co...