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

Consider vtkCompositePolyDataMpper in GetMTime for batched polydata mapper

- closes vtk/vtk#19395
- without it, the batched polydata mappers would not update the buffers even when the composite data display attributes may have been modified due to a scalar visibility setting change.
- the desktop mapper worked because it's `GetNeedToRebuildBufferObjects` indirectly compared the number of polydata in the current batch and previously rendered batch. This happened in `vtkStateStorage::operator !=()`. When the last block's scalar visibility was toggled from off to on, it recognized that the batch size has changed and uploaded the new batch of polydata.
- the wasm mapper did not because it's `IsUptoDate` did not know about batch size and returned true even when the composite data display attributes were modified.
- the fix could record the number of polydata in a batch and compare the number of polydata in `IsDataObjectUptoDate` with the last render. However, a better fix is to consider the MTime of the parent `vtkCompositePolyDataMapper` (that also considers the MTime of `vtkCompositeDataDisplayAttributes`) as the MTime concept was meant to fulfill this kind of state tracking need.
parent b87561c3
No related branches found
No related tags found
No related merge requests found
......@@ -1384,4 +1384,15 @@ int vtkOpenGLBatchedPolyDataMapper::CanUseTextureMapForColoring(vtkDataObject*)
return 1;
}
vtkMTimeType vtkOpenGLBatchedPolyDataMapper::GetMTime()
{
if (this->Parent)
{
return std::max(this->Superclass::GetMTime(), this->Parent->GetMTime());
}
else
{
return this->Superclass::GetMTime();
}
}
VTK_ABI_NAMESPACE_END
......@@ -72,6 +72,11 @@ public:
virtual void ProcessCompositePixelBuffers(vtkHardwareSelector* sel, vtkProp* prop,
GLBatchElement* glBatchElement, std::vector<unsigned int>& mypixels);
/**
* Returns the maximum of our and Parent vtkCompositePolyDataMapper's MTime
*/
vtkMTimeType GetMTime() override;
protected:
vtkOpenGLBatchedPolyDataMapper();
~vtkOpenGLBatchedPolyDataMapper() override;
......
......@@ -932,4 +932,15 @@ int vtkOpenGLLowMemoryBatchedPolyDataMapper::CanUseTextureMapForColoring(vtkData
return 1;
}
vtkMTimeType vtkOpenGLLowMemoryBatchedPolyDataMapper::GetMTime()
{
if (this->Parent)
{
return std::max(this->Superclass::GetMTime(), this->Parent->GetMTime());
}
else
{
return this->Superclass::GetMTime();
}
}
VTK_ABI_NAMESPACE_END
......@@ -74,6 +74,11 @@ public:
virtual void ProcessCompositePixelBuffers(vtkHardwareSelector* sel, vtkProp* prop,
GLBatchElement* glBatchElement, std::vector<unsigned int>& mypixels);
/**
* Returns the maximum of our and Parent vtkCompositePolyDataMapper's MTime
*/
vtkMTimeType GetMTime() override;
protected:
vtkOpenGLLowMemoryBatchedPolyDataMapper();
~vtkOpenGLLowMemoryBatchedPolyDataMapper() override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment