diff --git a/vtkm/interop/anari/ANARIMapperVolume.cxx b/vtkm/interop/anari/ANARIMapperVolume.cxx index 9243d4ad5..a12fde3dc 100644 --- a/vtkm/interop/anari/ANARIMapperVolume.cxx +++ b/vtkm/interop/anari/ANARIMapperVolume.cxx @@ -8,6 +8,7 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include #include namespace vtkm @@ -130,11 +131,11 @@ void ANARIMapperVolume::ConstructArrays(bool regenerate) const auto& fieldArray = actor.GetField().GetData(); const bool isStructured = cells.CanConvert>(); - const bool isFloat = fieldArray.CanConvert>(); + const bool isScalar = fieldArray.GetNumberOfComponentsFlat() == 1; this->Handles->ReleaseArrays(); - if (isStructured && isFloat) + if (isStructured && isScalar) { auto structuredCells = cells.AsCellSet>(); auto pdims = structuredCells.GetPointDimensions(); @@ -143,8 +144,7 @@ void ANARIMapperVolume::ConstructArrays(bool regenerate) auto d = this->GetDevice(); - arrays.Data = fieldArray.AsArrayHandle>(); - + vtkm::cont::ArrayCopyShallowIfPossible(fieldArray, arrays.Data); auto* ptr = (float*)arrays.Data.GetBuffers()[0].ReadPointerHost(*arrays.Token); auto bounds = coords.GetBounds();