Fix Fill for ArrayHandleView

The Fill method in the storage was filling the wrong buffers.
This commit is contained in:
Kenneth Moreland 2022-01-20 09:29:16 -07:00
parent c181cc08a9
commit 2b8d89fd50
2 changed files with 10 additions and 1 deletions

@ -179,7 +179,7 @@ public:
vtkm::Id adjustedEndIndex = (endIndex < indices.NumberOfValues)
? endIndex + 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,

@ -1364,6 +1364,15 @@ private:
//verify that the control portal works
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);
}
}
};