Skip to content
Snippets Groups Projects
Commit b17a0222 authored by Jaswant Panchumarti (Kitware)'s avatar Jaswant Panchumarti (Kitware)
Browse files

webgpu: use raw pointer instead of vtkWeakPointer

- This commit includes an optimization for large number of blocks or actors
  O(10,000) and higher.
- It gives a 10x performance boost. Previously, rendering 10,000 actors
  or 10,000 blocks in one actor with composite mapper took ~200 milliseconds
  per frame.
- With this commit, it only takes 20-25 ms per frame.
- The mapper's internal cache of actors is queried in every `RenderPiece`.
  During the query, when constructing a key for the `map::find`,
  the constructor and destructor of the vtkWeakPointer from a raw
  pointer took up roughly 50-60ms when repeated over O(10,000) actors
parent 9a053a8b
No related branches found
No related tags found
No related merge requests found
......@@ -442,8 +442,6 @@ protected:
int LastRepresentation = VTK_SURFACE;
bool LastHasRenderingTranslucentGeometry = false;
};
std::map<std::pair<vtkWeakPointer<vtkActor>, vtkWeakPointer<vtkRenderer>>, ActorState>
CachedActorRendererProperties;
private:
friend class vtkWebGPUComputeRenderBuffer;
......@@ -488,6 +486,8 @@ private:
CellDataAttributes::CELL_COLORS, CellDataAttributes::CELL_NORMALS
};
std::map<std::pair<vtkActor*, vtkRenderer*>, ActorState> CachedActorRendererProperties;
vtkWebGPUPolyDataMapper(const vtkWebGPUPolyDataMapper&) = delete;
void operator=(const vtkWebGPUPolyDataMapper&) = delete;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment