ArrayHandlePermutation wrapping an ArrayHandleGroupVecVariable fails for FieldOut
If you declare an ArrayHandle
with a type like
vtkm::cont::ArrayHandlePermutation<..., vtkm::cont::ArrayHandleGroupVecVariable<...>>
it fails if you try to pass it to a worklet with parameter FieldOut
. You should get vtkm::VecFromPortal
pointing to the correct entry. However, what you get is an uninitialized VecFromPortal
with 0 components.
The problem is that ArrayHandleGroupVecVariable
defines a special Fetch
for FieldOut
(in vtkm/exec/arg/FetchTagArrayDirectOutArrayHandleGroupVecVariable.h
) that has an actual Load
to set up the VecFromPortal
. When wrapped in an ArrayHandlePermutation
, you get the default Fetch
and you ignore the load.
This problem likely occurs when wrapping an ArrayHandleGroupVecVariable
in other fancy arrays.