// Copyright 2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "Iterator.ih"
#include "IteratorContextShared.h"
#include "DefaultIterator.ih"
#include "../volume/UnstructuredSamplerBase.ih"
#include "../volume/UnstructuredVolume.ih"

struct UnstructuredTraversalStatePublic
{
  uint64 node;  // can't export structs with varying pointers
  uint32 bitstack;
};

struct UnstructuredTraversalState
{
  uniform Node *node;
  uint32 bitstack;
};

struct UnstructuredIterator
{
  uniform DefaultHitIteratorIntervalIterator super;

  UnstructuredSamplerBase *uniform sampler;
  vec3f origin;
  vec3f direction;
  box1f tRange;

  UnstructuredTraversalStatePublic traversalState;
};
