VTK  9.7.1
vtkWebGPUPolyDataMapper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkWebGPUPolyDataMapper_h
4 #define vtkWebGPUPolyDataMapper_h
5 
6 #include "vtkPolyDataMapper.h"
7 
8 #include "vtkProperty.h" // for VTK_SURFACE constants
9 #include "vtkRenderingWebGPUModule.h" // for export macro
10 #include "vtkWebGPUCellToPrimitiveConverter.h" // for TopologySourceType
11 #include "vtkWebGPUComputePipeline.h" // for ivar
12 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
13 #include "vtk_wgpu.h" // for webgpu
14 
15 #include <array> // for ivar
16 #include <unordered_set> // for the not set compute render buffers
17 
18 VTK_ABI_NAMESPACE_BEGIN
19 class vtkCellArray;
21 class vtkWebGPUActor;
23 class vtkWebGPURenderer;
25 class vtkWebGPUTexture;
27 
28 class VTKRENDERINGWEBGPU_EXPORT VTK_MARSHALAUTO vtkWebGPUPolyDataMapper : public vtkPolyDataMapper
29 {
30 public:
31  static vtkWebGPUPolyDataMapper* New();
33  static vtkOverrideAttribute* CreateOverrideAttributes();
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
41  {
42  POINT_POSITIONS = 0,
49  POINT_UNDEFINED
50  };
51 
55  enum CellDataAttributes : int
56  {
57  CELL_COLORS = 0,
60  CELL_UNDEFINED
61  };
62 
69  {
70  // Pipeline that renders points, is best suitable for rendering 1-pixel wide points.
71  GFX_PIPELINE_POINTS = 0,
73  // Pipeline that renders points using a square or circle shape.
76  // Pipeline that is best suitable for rendering 1-pixel thick line segments
79  // Pipeline that can render lines thicker than 1-pixel. This pipeline does not
80  // create joining geometry between contiguous line segments in a polyline.
83  // Pipeline that renders lines with rounded caps and rounded joins.
86  // Pipeline that renders lines with miter joins.
89  // Pipeline that renders triangles
92  GFX_PIPELINE_NB_TYPES
93  };
94 
96 
100  void RenderPiece(vtkRenderer* renderer, vtkActor* act) override;
101 
107  void ReleaseGraphicsResources(vtkWindow*) override;
108 
115  bool GetSupportsSelection() override { return false; }
116 
128  void MapDataArrayToVertexAttribute(const char* vertexAttributeName, const char* dataArrayName,
129  int fieldAssociation, int componentno = -1) override;
130 
138  void MapDataArrayToMultiTextureAttribute(const char* tname, const char* dataArrayName,
139  int fieldAssociation, int componentno = -1) override;
140 
144  void RemoveVertexAttributeMapping(const char* vertexAttributeName) override;
145 
149  void RemoveAllVertexAttributeMappings() override;
150 
156  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets, vtkProp* prop) override;
157 
173  vtkSmartPointer<vtkWebGPUComputeRenderBuffer> AcquirePointAttributeComputeRenderBuffer(
174  PointDataAttributes attribute, int bufferGroup, int bufferBinding, int uniformsGroup,
175  int uniformsBinding);
176 
180  vtkSmartPointer<vtkWebGPUComputeRenderBuffer> AcquireCellAttributeComputeRenderBuffer(
181  CellDataAttributes attribute, int bufferGroup, int bufferBinding, int uniformsGroup,
182  int uniformsBinding);
183 
184 protected:
186  ~vtkWebGPUPolyDataMapper() override;
187 
193  void ComputeBounds() override;
194 
199  void RecordDrawCommands(
200  vtkRenderer* renderer, vtkActor* actor, const wgpu::RenderPassEncoder& passEncoder);
201  void RecordDrawCommands(
202  vtkRenderer* renderer, vtkActor* actor, const wgpu::RenderBundleEncoder& bundleEncoder);
203 
208  virtual void DeducePointCellAttributeAvailability();
209 
214  virtual std::vector<wgpu::BindGroupLayoutEntry> GetMeshBindGroupLayoutEntries();
215 
220  virtual std::vector<wgpu::BindGroupLayoutEntry> GetTopologyBindGroupLayoutEntries(
221  bool homogeneousCellSize, bool useEdgeArray);
222 
227  virtual std::vector<wgpu::BindGroupEntry> GetMeshBindGroupEntries();
228 
233  virtual std::vector<wgpu::BindGroupEntry> GetTopologyBindGroupEntries(
235  bool homogeneousCellSize, bool useEdgeArray);
236 
240  virtual unsigned long GetPointAttributeByteSize(
242 
246  virtual unsigned long GetCellAttributeByteSize(
248 
253  virtual bool ShouldReleaseGraphicsResourcesOnSync();
254 
258  virtual void BeginUpdateMeshGeometryBuffers();
268  virtual void UpdateMeshGeometryBuffers(vtkWebGPUConfiguration* wgpuConfiguration);
269 
273  virtual void EndUpdateMeshGeometryBuffers();
274 
279  virtual bool EnsureInput();
280 
284  virtual void UpdateMeshTopologyBuffers(
285  vtkWebGPUConfiguration* wgpuConfiguration, vtkProperty* displayProperty);
286 
287  virtual std::vector<wgpu::VertexBufferLayout> GetVertexBufferLayouts() { return {}; }
288 
289  virtual void SetVertexBuffers(const wgpu::RenderPassEncoder& vtkNotUsed(passEncoder)) {}
290  virtual void SetVertexBuffers(const wgpu::RenderBundleEncoder& vtkNotUsed(bundleEncoder)) {}
291 
295  virtual void ApplyShaderReplacements(GraphicsPipelineType pipelineType,
296  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
297 
298  virtual void ReplaceShaderConstantsDef(GraphicsPipelineType pipelineType,
299  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
300  virtual void ReplaceShaderActorDef(GraphicsPipelineType pipelineType, vtkWebGPURenderer* renderer,
301  vtkWebGPUActor* actor, std::string& vss, std::string& fss);
302  virtual void ReplaceShaderClippingPlanesDef(GraphicsPipelineType pipelineType,
303  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
304  virtual void ReplaceShaderCustomDef(GraphicsPipelineType pipelineType,
305  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
306 
307  virtual void ReplaceShaderRendererBindings(GraphicsPipelineType pipelineType,
308  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
309  virtual void ReplaceShaderActorBindings(GraphicsPipelineType pipelineType,
310  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
311  virtual void ReplaceShaderClippingPlanesBindings(GraphicsPipelineType pipelineType,
312  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
313  virtual void ReplaceShaderMeshAttributeBindings(GraphicsPipelineType pipelineType,
314  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
315  virtual void ReplaceShaderCustomBindings(GraphicsPipelineType pipelineType,
316  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
317  virtual void ReplaceShaderTopologyBindings(GraphicsPipelineType pipelineType,
318  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
319  virtual void ReplaceShaderVertexOutputDef(GraphicsPipelineType pipelineType,
320  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss, std::string& fss);
321 
322  virtual void ReplaceVertexShaderInputDef(GraphicsPipelineType pipelineType,
323  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
324  virtual void ReplaceVertexShaderMainStart(GraphicsPipelineType pipelineType,
325  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
326  virtual void ReplaceVertexShaderCamera(GraphicsPipelineType pipelineType,
327  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
328  virtual void ReplaceVertexShaderNormalTransform(GraphicsPipelineType pipelineType,
329  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
330  virtual void ReplaceVertexShaderVertexId(GraphicsPipelineType pipelineType,
331  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
332  virtual void ReplaceVertexShaderPrimitiveId(GraphicsPipelineType pipelineType,
333  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
334  virtual void ReplaceVertexShaderCellId(GraphicsPipelineType pipelineType,
335  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
336  virtual void ReplaceVertexShaderPosition(GraphicsPipelineType pipelineType,
337  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
338  virtual void ReplaceVertexShaderClippingPlanes(GraphicsPipelineType pipelineType,
339  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
340  virtual void ReplaceVertexShaderPositionVC(GraphicsPipelineType pipelineType,
341  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
342  virtual void ReplaceVertexShaderPicking(GraphicsPipelineType pipelineType,
343  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
344  virtual void ReplaceVertexShaderColors(GraphicsPipelineType pipelineType,
345  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
346  virtual void ReplaceVertexShaderUVs(GraphicsPipelineType pipelineType,
347  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
348  virtual void ReplaceVertexShaderEdges(GraphicsPipelineType pipelineType,
349  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
350  virtual void ReplaceVertexShaderNormals(GraphicsPipelineType pipelineType,
351  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
352  virtual void ReplaceVertexShaderTangents(GraphicsPipelineType pipelineType,
353  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
354  virtual void ReplaceVertexShaderMainEnd(GraphicsPipelineType pipelineType,
355  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& vss);
356 
357  virtual void ReplaceFragmentShaderOutputDef(GraphicsPipelineType pipelineType,
358  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
359 
360  virtual void ReplaceFragmentShaderMainStart(GraphicsPipelineType pipelineType,
361  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
362  virtual void ReplaceFragmentShaderClippingPlanes(GraphicsPipelineType pipelineType,
363  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
364  virtual void ReplaceFragmentShaderColors(GraphicsPipelineType pipelineType,
365  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
366  virtual void ReplaceFragmentShaderNormals(GraphicsPipelineType pipelineType,
367  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
368  virtual void ReplaceFragmentShaderEdges(GraphicsPipelineType pipelineType,
369  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
370  virtual void ReplaceFragmentShaderLights(GraphicsPipelineType pipelineType,
371  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
372  virtual void ReplaceFragmentShaderPicking(GraphicsPipelineType pipelineType,
373  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
374  virtual void ReplaceFragmentShaderCoincidentOffset(GraphicsPipelineType pipelineType,
375  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
376  virtual void ReplaceFragmentShaderMainEnd(GraphicsPipelineType pipelineType,
377  vtkWebGPURenderer* renderer, vtkWebGPUActor* actor, std::string& fss);
378 
387  virtual bool IsPipelineSupported(GraphicsPipelineType vtkNotUsed(pipelineType)) { return true; }
388  static bool IsPipelineForHomogeneousCellSize(GraphicsPipelineType pipelineType);
389 
393  virtual wgpu::PrimitiveTopology GetPrimitiveTopologyForPipeline(
394  GraphicsPipelineType pipelineType);
395 
397  {
398  std::uint32_t VertexOffset = 0;
399  std::uint32_t VertexCount = 0;
400  std::uint32_t InstanceOffset = 0;
401  std::uint32_t InstanceCount = 0;
402  };
403  virtual DrawCallArgs GetDrawCallArgs(GraphicsPipelineType pipelineType,
405  virtual DrawCallArgs GetDrawCallArgsForDrawingVertices(
407 
412  wgpu::BindGroup CreateMeshAttributeBindGroup(
413  const wgpu::Device& device, const std::string& label);
414 
420  wgpu::BindGroup CreateTopologyBindGroup(const wgpu::Device& device, const std::string& label,
422 
424  {
425  wgpu::Buffer Buffer;
426  uint64_t Size = 0;
427  uint64_t Watermark = 0;
428  bool Touched = false;
429  };
430  AttributeBuffer PointBuffers[POINT_NB_ATTRIBUTES];
431  AttributeBuffer CellBuffers[CELL_NB_ATTRIBUTES];
432  struct
433  {
434  vtkTypeFloat32 PlaneEquations[6][4];
435  vtkTypeUInt32 PlaneCount = 0;
436  } ClippingPlanesData;
437  wgpu::Buffer ClippingPlanesBuffer;
438 
440  vtkTimeStamp CellAttributesBuildTimestamp[CELL_NB_ATTRIBUTES];
441  vtkTimeStamp PointAttributesBuildTimestamp[POINT_NB_ATTRIBUTES];
444 
445  bool HasPointAttributes[POINT_NB_ATTRIBUTES];
446  bool HasCellAttributes[CELL_NB_ATTRIBUTES];
447  bool RebuildGraphicsPipelines = true;
448  // used by RenderPiece and functions it calls to reduce
449  // calls to get the input and allow for rendering of
450  // other polydata (not the input)
451  vtkPolyData* CurrentInput = nullptr;
452  // vtkRenderer culls props to frustum. At that point, it requests
453  // mappers for bounds of the geometry. We cache the vtkAlgorithm output
454  // so that `UpdateMeshGeometryBuffers` can reuse it without climbing up
455  // vtkAlgorithm pipeline.
456  vtkPolyData* CachedInput = nullptr;
458 
459  // 1 bind group for this polydata mesh
460  wgpu::BindGroup MeshAttributeBindGroup;
461  std::vector<std::uint32_t> MeshAttributeDynamicOffsets;
462 
464  {
465  // buffer for point ids.
466  wgpu::Buffer ConnectivityBuffer;
467  // buffer for the cell ids.
468  wgpu::Buffer CellIdBuffer;
469  // buffer for edge array. this lets fragment shader hide internal edges of a polygon
470  // when edge visibility is turned on.
471  wgpu::Buffer EdgeArrayBuffer;
472  // uniform buffer for cell id offset.
474  // // buffer for indirect draw command
475  // wgpu::Buffer IndirectDrawBuffer;
476  // bind group for the primitive size uniform.
477  wgpu::BindGroup BindGroup;
478  // maximum number of vertices in a cell
479  vtkTypeUInt32 MaxCellSize = 0;
480  // vertexCount for draw call.
481  vtkTypeUInt32 VertexCount = 0;
482  // composite vertex offset and counts for drawing composite data
483  std::vector<std::pair<vtkTypeUInt32, vtkTypeUInt32>> VertexOffsetAndCounts;
484  };
485 
486  enum BindingGroup : int
487  {
488  GROUP_RENDERER = 0,
489  GROUP_ACTOR = 1,
490  GROUP_TEXTURES = GROUP_ACTOR,
491  GROUP_MESH = 2,
492  // Clipping planes are bound to the same group as the mesh attributes
493  // because they vary based on the mapper's shift/scale and the actor's
494  // transformation matrix.
495  GROUP_CLIPPING_PLANES = GROUP_MESH,
496  GROUP_TOPOLOGY = 3,
497  GROUP_NB_BINDGROUPS = 4
498  };
499  static_assert(GROUP_NB_BINDGROUPS <= 4,
500  "Number of bind groups exceeds 4! Most devices can support only up to 4 bind groups");
501  std::array<std::uint32_t, GROUP_NB_BINDGROUPS> NumberOfBindings = {};
505  std::string GraphicsPipelineKeys[GFX_PIPELINE_NB_TYPES] = {};
506 
507 private:
509  void operator=(const vtkWebGPUPolyDataMapper&) = delete;
511  friend class vtkWebGPURenderer;
512 
516  wgpu::Buffer GetPointDataWGPUBuffer(PointDataAttributes attribute)
517  {
518  return this->PointBuffers[attribute].Buffer;
519  }
520 
524  wgpu::Buffer GetCellDataWGPUBuffer(CellDataAttributes attribute)
525  {
526  return this->CellBuffers[attribute].Buffer;
527  }
528 
532  void UploadAttributeToGPUBuffer(vtkWebGPUConfiguration* wgpuConfiguration,
533  vtkDataArray* dataArray, PointDataAttributes attributeType, float denominator = 1.0f);
534  void UploadAttributeToGPUBuffer(vtkWebGPUConfiguration* wgpuConfiguration,
535  vtkDataArray* dataArray, CellDataAttributes attributeType, float denominator = 1.0f);
536 
542  bool GetNeedToRebuildGraphicsPipelines(vtkActor* actor, vtkRenderer* renderer);
543 
554  bool CacheActorRendererProperties(vtkActor* actor, vtkRenderer* renderer);
555 
559  void ResetPointCellAttributeState();
560 
564  wgpu::BindGroupLayout CreateMeshAttributeBindGroupLayout(
565  const wgpu::Device& device, const std::string& label);
566 
570  wgpu::BindGroupLayout CreateTopologyBindGroupLayout(const wgpu::Device& device,
571  const std::string& label, bool homogeneousCellSize, bool useEdgeArray);
572 
577  unsigned long GetPointAttributeElementSize(
579 
584  unsigned long GetCellAttributeElementSize(vtkWebGPUPolyDataMapper::CellDataAttributes attribute);
585 
591  unsigned long GetExactPointBufferSize(PointDataAttributes attribute);
592 
598  unsigned long GetExactCellBufferSize(CellDataAttributes attribute);
599 
603  bool AllocateAttributeBuffers(vtkWebGPUConfiguration* wgpuConfiguration);
604 
608  const char* GetGraphicsPipelineTypeAsString(GraphicsPipelineType graphicsPipelineType);
609 
614  void SetupGraphicsPipelines(const wgpu::Device& device, vtkRenderer* renderer, vtkActor* actor);
615 
619  void UpdateClippingPlanesBuffer(vtkWebGPUConfiguration* wgpuConfiguration, vtkActor* actor);
620 
627  std::vector<vtkSmartPointer<vtkWebGPUComputeRenderBuffer>> SetupComputeRenderBuffers;
628 
632  std::unordered_set<vtkSmartPointer<vtkWebGPUComputeRenderBuffer>> NotSetupComputeRenderBuffers;
633 
637  const PointDataAttributes PointDataAttributesOrder[PointDataAttributes::POINT_NB_ATTRIBUTES] = {
638  PointDataAttributes::POINT_POSITIONS, PointDataAttributes::POINT_COLORS,
639  PointDataAttributes::POINT_NORMALS, PointDataAttributes::POINT_TANGENTS,
640  PointDataAttributes::POINT_UVS, PointDataAttributes::POINT_COLOR_UVS
641  };
642 
646  const CellDataAttributes CellDataAttributesOrder[CellDataAttributes::CELL_NB_ATTRIBUTES] = {
647  CellDataAttributes::CELL_COLORS, CellDataAttributes::CELL_NORMALS
648  };
649 
650  // Cache these so that subsequent executions of UpdateMeshGeometryBuffers() do not unnecessarily
651  // invoke MapScalars().
652  int LastScalarMode = -1;
653  bool LastScalarVisibility = false;
654  vtkTypeUInt32 LastNumClipPlanes = 0;
655  struct ActorState
656  {
657  bool LastActorBackfaceCulling = false;
658  bool LastActorFrontfaceCulling = false;
659  bool LastVertexVisibility = false;
660  int LastRepresentation = VTK_SURFACE;
661  bool LastHasRenderingTranslucentGeometry = false;
662  int LastPointSize = 1;
663  int LastLineWidth = 1;
664  };
665  std::map<std::pair<vtkActor*, vtkRenderer*>, ActorState> CachedActorRendererProperties;
666 };
667 #define vtkWebGPUPolyDataMapper_OVERRIDE_ATTRIBUTES \
668  vtkWebGPUPolyDataMapper::CreateOverrideAttributes()
669 VTK_ABI_NAMESPACE_END
670 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
virtual std::vector< wgpu::VertexBufferLayout > GetVertexBufferLayouts()
Attribute for vtkObjectFactory overrides.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
vtkSmartPointer< vtkWebGPUTexture > ColorTextureHostResource
virtual MapperHashType GenerateHash(vtkPolyData *)
This hash integer is computed by concrete graphics implementation of this class.
virtual void MapDataArrayToMultiTextureAttribute(const char *textureName, const char *dataArrayName, int fieldAssociation, int componentno=-1)
virtual void RemoveAllVertexAttributeMappings()
Remove all vertex attributes.
virtual bool IsPipelineSupported(GraphicsPipelineType pipelineType)
Whether shaders must be built to target the specific pipeline.
represent surface properties of a geometric object
Definition: vtkProperty.h:59
#define VTK_SURFACE
Definition: vtkProperty.h:45
std::vector< std::pair< vtkTypeUInt32, vtkTypeUInt32 > > VertexOffsetAndCounts
vtkWebGPUTexture is a concrete implementation of the abstract class vtkTexture for WebGPU...
record modification and/or execution time
Definition: vtkTimeStamp.h:24
virtual void SetVertexBuffers(const wgpu::RenderBundleEncoder &bundleEncoder)
abstract specification for renderers
Definition: vtkRenderer.h:63
GraphicsPipelineType
This mapper uses different wgpu::RenderPipeline to render a list of primitives.
virtual void RenderPiece(vtkRenderer *, vtkActor *)
Implemented by sub classes.
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &, vtkProp *)
allows a mapper to update a selections color buffers Called from a prop which in turn is called from ...
Definition: vtkMapper.h:469
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
virtual void SetVertexBuffers(const wgpu::RenderPassEncoder &passEncoder)
virtual void RemoveVertexAttributeMapping(const char *vertexAttributeName)
Remove a vertex attribute mapping.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
vtkNew< vtkWebGPUCellToPrimitiveConverter > CellConverter
std::uintptr_t MapperHashType
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_NEWINSTANCE
virtual void ComputeBounds()
Called in GetBounds().
std::vector< std::uint32_t > MeshAttributeDynamicOffsets
Render buffers are returned by calls to vtkWebGPUPolyDataMapper::AcquirePointAttributeComputeRenderBu...
virtual void MapDataArrayToVertexAttribute(const char *vertexAttributeName, const char *dataArrayName, int fieldAssociation, int componentno=-1)
Select a data array from the point/cell data and map it to a generic vertex attribute.
map vtkPolyData to graphics primitives
object to represent cell connectivity
Definition: vtkCellArray.h:177
Create a webgpu device for use in rendering and compute pipelines.
static vtkPolyDataMapper * New()
PointDataAttributes
All the attributes supported by the point data buffer.
TopologySourceType
All supported types of topology.
#define VTK_MARSHALAUTO
WebGPU rendering window.
vtkTimeStamp ClippingPlanesBuildTimestamp
Timestamps help reuse previous resources as much as possible.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
Definition: vtkMapper.h:105
CellDataAttributes
All the attributes supported by the cell data buffer.