godot/thirdparty/embree/kernels/common/instance_stack.h

// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "rtcore.h"

namespace embree {
namespace instance_id_stack {

static_assert;

/*******************************************************************************
 * Instance ID stack manipulation.
 * This is used from the instance intersector.
 ******************************************************************************/

/* 
 * Push an instance to the stack. 
 */
template<typename Context>
RTC_FORCEINLINE bool push(Context context,
                          unsigned instanceId,
                          unsigned instancePrimId)
{}

/* 
 * Pop the last instance pushed to the stack. 
 * Do not call on an empty stack. 
 */
template<typename Context>
RTC_FORCEINLINE void pop(Context context)
{}


/* Push an instance to the stack. Used for point queries*/
RTC_FORCEINLINE bool push(RTCPointQueryContext* context,
                          unsigned int instanceId,
                          unsigned int instancePrimId,
                          AffineSpace3fa const& w2i,
                          AffineSpace3fa const& i2w)
{}

template<>
RTC_FORCEINLINE void pop(RTCPointQueryContext* context)
{}

/*
 * Optimized instance id stack copy.
 * The copy() functions will either copy full
 * stacks or copy only until the last valid element has been copied, depending
 * on RTC_MAX_INSTANCE_LEVEL_COUNT.
 */
RTC_FORCEINLINE void copy_UU(const unsigned* src, unsigned* tgt)
{}

RTC_FORCEINLINE void copy_UU(const RTCRayQueryContext* context, const unsigned* src, unsigned* tgt)
{}
  
template <int K>
RTC_FORCEINLINE void copy_UV(const unsigned* src, vuint<K>* tgt)
{}

template <int K>
RTC_FORCEINLINE void copy_UV(const unsigned* src, vuint<K>* tgt, size_t j)
{}

template <int K>
RTC_FORCEINLINE void copy_UV(const unsigned* src, vuint<K>* tgt, const vbool<K>& mask)
{}

template <int K>
RTC_FORCEINLINE void copy_VU(const vuint<K>* src, unsigned* tgt, size_t i)
{}

template <int K>
RTC_FORCEINLINE void copy_VV(const vuint<K>* src, vuint<K>* tgt, size_t i, size_t j)
{}

template <int K>
RTC_FORCEINLINE void copy_VV(const vuint<K>* src, vuint<K>* tgt, const vbool<K>& mask)
{}

} // namespace instance_id_stack
} // namespace embree