Fix Fill for ArrayHandleView
The Fill method in the storage was filling the wrong buffers.
This commit is contained in:
parent
c181cc08a9
commit
2b8d89fd50
@ -179,7 +179,7 @@ public:
|
|||||||
vtkm::Id adjustedEndIndex = (endIndex < indices.NumberOfValues)
|
vtkm::Id adjustedEndIndex = (endIndex < indices.NumberOfValues)
|
||||||
? endIndex + indices.StartIndex
|
? endIndex + indices.StartIndex
|
||||||
: indices.NumberOfValues + indices.StartIndex;
|
: indices.NumberOfValues + indices.StartIndex;
|
||||||
SourceStorage::Fill(buffers, fillValue, adjustedStartIndex, adjustedEndIndex, token);
|
SourceStorage::Fill(buffers + 1, fillValue, adjustedStartIndex, adjustedEndIndex, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_CONT static WritePortalType CreateWritePortal(vtkm::cont::internal::Buffer* buffers,
|
VTKM_CONT static WritePortalType CreateWritePortal(vtkm::cont::internal::Buffer* buffers,
|
||||||
|
@ -1364,6 +1364,15 @@ private:
|
|||||||
|
|
||||||
//verify that the control portal works
|
//verify that the control portal works
|
||||||
CheckPortal(view.ReadPortal());
|
CheckPortal(view.ReadPortal());
|
||||||
|
|
||||||
|
//verify that filling works
|
||||||
|
const ValueType expected = TestValue(20, ValueType{});
|
||||||
|
view.Fill(expected);
|
||||||
|
auto valuesPortal = values.ReadPortal();
|
||||||
|
for (vtkm::Id index = length; index < 2 * length; ++index)
|
||||||
|
{
|
||||||
|
VTKM_TEST_ASSERT(valuesPortal.Get(index) == expected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user