Commit ce9f4e1d authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fix issues with vtkPVRenderView::SetForceDataDistributionMode.

When distribution mode was forced on vtkPVRenderView, we're operating in
a non-standard environment where the nodes that ParaView things should
have the geometry for rendering (based on the which nodes are doing the
rendering) may not have the correct data. For example, to force all
geometry rendering to happen on rank 0, a representation may set the
forced data distribution mode to `vtkMPIMoveData::COLLECT` and still be
in remote rendering mode (and not render-on-client). Since forced
distribution mode can thrown a wrench in the logic to keep track of
which data have been delivered to which nodes, we opt for being
conservative and simply clear delivery metadata when forced render mode
changes.

This builds on fixes in 3b15cd74.
parent eccd05e0
......@@ -626,7 +626,15 @@ void vtkPVDataDeliveryManager::Deliver(int use_lod, unsigned int size, unsigned
}
dataMover->SetInputData(data);
dataMover->Update();
if (dataMover->GetOutputGeneratedOnProcess())
if (dataMover->GetOutputGeneratedOnProcess() ||
/* when ForceDataDistributionMode is set, the node rendering and the
* node having valid data don't necessary line up. Hence we take the
* safest approach i.e. we'll update the rendered geometry on each
* deliver. When `ForceDataDistributionMode` is toggled back, we redo
* all the geometry delivery as appropriate. See also
* `vtkSMDataDeliveryManager::Deliver`.
*/
this->RenderView->IsForceDataDistributionModeSet())
{
item->SetDeliveredDataObject(dataMover->GetOutputDataObject(0));
}
......
......@@ -535,6 +535,7 @@ public:
}
//@}
//@{
/**
* This is an temporary/experimental option and may be removed without notice.
* This is intended to be used within some experimental representations that
......@@ -548,6 +549,9 @@ public:
* ordered compositing will also be disabled.
*/
static void SetForceDataDistributionMode(vtkInformation* info, int flag);
bool IsForceDataDistributionModeSet() const { return this->ForceDataDistributionMode != -1; }
int GetForceDataDistributionMode() const { return this->ForceDataDistributionMode; }
//@}
//@{
/**
......
......@@ -31,6 +31,8 @@
vtkStandardNewMacro(vtkSMDataDeliveryManager);
//----------------------------------------------------------------------------
vtkSMDataDeliveryManager::vtkSMDataDeliveryManager()
: PreviousForceDataDistributionMode(-1)
{
}
......@@ -60,6 +62,19 @@ void vtkSMDataDeliveryManager::Deliver(bool interactive)
? view->GetUseDistributedRenderingForInteractiveRender()
: view->GetUseDistributedRenderingForStillRender();
if (this->PreviousForceDataDistributionMode != view->GetForceDataDistributionMode())
{
// if distribution mode is forced and different from previous,
// there's no guarantee what it will be and which nodes will have geometry.
// So we simply clear delivery timestamps to do deliveries with a clean
// slate.
this->PreviousForceDataDistributionMode = view->GetForceDataDistributionMode();
for (int cc = 0; cc < 4; ++cc)
{
this->DeliveryTimestamps[cc] = vtkTimeStamp();
}
}
vtkMTimeType update_ts = view->GetUpdateTimeStamp();
int delivery_type = LOCAL_RENDERING_AND_FULL_RES;
if (!use_lod && use_distributed_rendering)
......
......@@ -76,6 +76,7 @@ protected:
REMOTE_RENDERING_AND_LOW_RES = 3,
};
vtkTimeStamp DeliveryTimestamps[4];
int PreviousForceDataDistributionMode;
private:
vtkSMDataDeliveryManager(const vtkSMDataDeliveryManager&) = delete;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment