3#ifndef vtkWebGPUPolyDataMapper_h
4#define vtkWebGPUPolyDataMapper_h
8#include "vtkRenderingWebGPUModule.h"
12#include <unordered_set>
14VTK_ABI_NAMESPACE_BEGIN
16class vtkTypeFloat32Array;
95 int fieldAssociation,
int componentno = -1)
override;
103 int fieldAssociation,
int componentno = -1)
override;
139 int uniformsBinding);
146 int uniformsBinding);
324 wgpu::Buffer GetPointDataWGPUBuffer() {
return this->MeshSSBO.
Point.
Buffer; }
329 wgpu::Buffer GetCellDataWGPUBuffer() {
return this->MeshSSBO.
Cell.
Buffer; }
337 std::vector<vtkSmartPointer<vtkWebGPUComputeRenderBuffer>> SetupComputeRenderBuffers;
342 std::unordered_set<vtkSmartPointer<vtkWebGPUComputeRenderBuffer>> NotSetupComputeRenderBuffers;
347 const PointDataAttributes PointDataAttributesOrder[PointDataAttributes::POINT_NB_ATTRIBUTES] = {
348 PointDataAttributes::POINT_POSITIONS, PointDataAttributes::POINT_COLORS,
349 PointDataAttributes::POINT_NORMALS, PointDataAttributes::POINT_TANGENTS,
350 PointDataAttributes::POINT_UVS
356 const CellDataAttributes CellDataAttributesOrder[CellDataAttributes::CELL_NB_ATTRIBUTES] = {
357 CellDataAttributes::CELL_EDGES, CellDataAttributes::CELL_COLORS,
358 CellDataAttributes::CELL_NORMALS
361 vtkWebGPUPolyDataMapper(
const vtkWebGPUPolyDataMapper&) =
delete;
362 void operator=(
const vtkWebGPUPolyDataMapper&) =
delete;
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
object to represent cell connectivity
a simple class to control print indentation
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract superclass for all actors, volumes and annotations
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
Render buffers are returned by calls to vtkWebGPUPolyDataMapper::AcquirePointAttributeComputeRenderBu...
PointDataAttributes
All the attributes supported by the point data buffer.
unsigned long GetPointAttributeByteSize(vtkWebGPUPolyDataMapper::PointDataAttributes attribute)
Returns the size of the 'sub-buffer' within the whole point data SSBO for the given attribute.
wgpu::BindGroupLayout MeshAttributeBindGroupLayout
vtkTimeStamp PointCellAttributesBuildTimestamp
void ProcessSelectorPixelBuffers(vtkHardwareSelector *sel, std::vector< unsigned int > &pixeloffsets, vtkProp *prop) override
allows a mapper to update a selections color buffers Called from a prop which in turn is called from ...
bool GetSupportsSelection() override
void SetupBindGroups(const wgpu::Device &device, vtkRenderer *renderer)
Creates bind groups for all the buffers in the MeshGeometryBuffers struct.
PrimitiveBindGroupInfo PointPrimitiveBGInfo
wgpu::BindGroup MeshAttributeBindGroup
bool UpdatedPrimitiveSizes
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
PrimitiveBindGroupInfo TrianglePrimitiveBGInfo
bool UpdatedPrimitiveBuffers
vtkIdType GetPointAttributeByteOffset(PointDataAttributes attribute)
Returns the offset at which the 'sub-buffer' of 'attribute' starts within the mesh SSBO point data bu...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned long GetCellAttributeElementSize(vtkWebGPUPolyDataMapper::CellDataAttributes attribute)
Returns the size in bytes of one element of the given attribute.
friend class vtkWebGPURenderer
void MapDataArrayToVertexAttribute(const char *vertexAttributeName, const char *dataArrayName, int fieldAssociation, int componentno=-1) override
Select a data array from the point/cell data and map it to a generic vertex attribute.
void EncodeRenderCommands(vtkRenderer *renderer, vtkActor *act, const wgpu::RenderBundleEncoder &bundleEncoder)
void RemoveAllVertexAttributeMappings() override
Remove all vertex attributes.
bool UpdatedGeometryBuffers
wgpu::ShaderModule Shader
PrimitiveBindGroupInfo LinePrimitiveBGInfo
unsigned long EdgeArrayCount
MeshAttributeBuffers MeshSSBO
vtkSmartPointer< vtkWebGPUComputeRenderBuffer > AcquirePointAttributeComputeRenderBuffer(PointDataAttributes attribute, int bufferGroup, int bufferBinding, int uniformsGroup, int uniformsBinding)
Returns an already configured (ready to be added to a vtkWebGPUComputePipeline) buffer bound to the g...
void SetupPipelineLayout(const wgpu::Device &device, vtkRenderer *renderer, vtkActor *actor)
Sets up bindgroup layouts and creates a pipeline layout.
vtkSmartPointer< vtkWebGPUComputeRenderBuffer > AcquireCellAttributeComputeRenderBuffer(CellDataAttributes attribute, int bufferGroup, int bufferBinding, int uniformsGroup, int uniformsBinding)
Same as AcquirePointAttributeComputeRenderBuffer but for cell data attributes.
wgpu::PipelineLayout PipelineLayout
unsigned long GetExactPointBufferSize()
Enqueues a write command on the device queue for all buffers whose data is outdated.
void ShallowCopy(vtkAbstractMapper *m) override
Make a shallow copy of this mapper.
vtkIdType GetCellAttributeByteOffset(CellDataAttributes attribute)
Returns the offset at which the 'sub-buffer' of 'attribute' starts within the mesh SSBO cell data buf...
vtkPolyData * CurrentInput
vtkWebGPUPolyDataMapper()
bool UpdateMeshIndexBuffers(const wgpu::Device &device)
void RemoveVertexAttributeMapping(const char *vertexAttributeName) override
Remove a vertex attribute mapping.
static vtkWebGPUPolyDataMapper * New()
vtkTypeFloat32Array * ComputeEdgeArray(vtkCellArray *polys)
~vtkWebGPUPolyDataMapper() override
bool UpdateMeshGeometryBuffers(vtkWebGPURenderWindow *wgpuRenWin, const wgpu::Device &device, vtkActor *actor)
void MapDataArrayToMultiTextureAttribute(const char *tname, const char *dataArrayName, int fieldAssociation, int componentno=-1) override
void EncodeRenderCommands(vtkRenderer *renderer, vtkActor *act, const wgpu::RenderPassEncoder &passEncoder)
unsigned long GetCellAttributeByteSize(vtkWebGPUPolyDataMapper::CellDataAttributes attribute)
Returns the size of the 'sub-buffer' within the whole cell data SSBO for the given attribute.
bool LastScalarVisibility
std::vector< unsigned long > GetExactConnecitivityBufferSizes()
vtkPolyData * CachedInput
void SetupGraphicsPipeline(const wgpu::Device &device, vtkRenderer *renderer, vtkActor *actor)
Creates the graphics pipeline.
friend class vtkWebGPUComputeRenderBuffer
void RenderPiece(vtkRenderer *ren, vtkActor *act) override
Implemented by sub classes.
wgpu::BindGroupLayout PrimitiveBindGroupLayout
vtkTimeStamp Primitive2CellIDsBuildTimestamp
unsigned long GetExactCellBufferSize()
wgpu::Buffer AttributeDescriptorBuffer
unsigned long GetPointAttributeElementSize(vtkWebGPUPolyDataMapper::PointDataAttributes attribute)
Returns the size in bytes of one element of the given attribute.
vtkDataArray * LastColors
CellDataAttributes
All the attributes supported by the cell data buffer.
void ComputeBounds() override
Called in GetBounds().
window superclass for vtkRenderWindow
vtkTypeUInt32 NumComponents
struct vtkWebGPUPolyDataMapper::MeshAttributeBuffers::@320066264313321177165367213064212262215077312156 Cell
struct vtkWebGPUPolyDataMapper::MeshAttributeBuffers::@322277060310063306147312044355276063234262207064 Point
AttributeDescriptor Positions
AttributeDescriptor CellColors
AttributeDescriptor CellNormals
AttributeDescriptor Normals
AttributeDescriptor CellEdgeArray
AttributeDescriptor Colors
AttributeDescriptor Tangents
wgpu::BindGroup BindGroup
wgpu::Buffer PrimitiveSizeBuffer
vtkTypeUInt32 VertexCount
wgpu::RenderPipeline Pipeline