File: node_type.h

package info (click to toggle)
level-zero-gpu-raytracing 1.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,560 kB
  • sloc: cpp: 43,788; ansic: 1,342; makefile: 21; sh: 14
file content (56 lines) | stat: -rw-r--r-- 1,617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <cstdint>
#include <iostream>

namespace embree
{
  /* The type of a node. */
  enum NodeType : uint8_t
  {
    NODE_TYPE_MIXED = 0x0,        // identifies a mixed internal node where each child can have a different type
    NODE_TYPE_INTERNAL = 0x0,     // internal BVH node with 6 children
    NODE_TYPE_INSTANCE = 0x1,     // instance leaf
    NODE_TYPE_PROCEDURAL = 0x3,   // procedural leaf
    NODE_TYPE_QUAD = 0x4,         // quad leaf
    NODE_TYPE_INVALID = 0x7       // indicates invalid node
  };

  /* output operator for NodeType */
  inline std::ostream& operator<<(std::ostream& _cout, const NodeType& _type)
  {
#if !defined(__RTRT_GSIM)
    switch (_type)
    {
    case NODE_TYPE_INTERNAL: _cout << "INTERNAL"; break;
    case NODE_TYPE_INSTANCE: _cout << "INSTANCE"; break;
    case NODE_TYPE_PROCEDURAL: _cout << "PROCEDURAL"; break;
    case NODE_TYPE_QUAD: _cout << "QUAD"; break;
    case NODE_TYPE_INVALID: _cout << "INVALID"; break;
    default: _cout << "INVALID NODE TYPE"; break;
    }
#endif
    return _cout;
  };

  /* 
     Sub-type definition for each NodeType
  */

  enum SubType : uint8_t
  {
    SUB_TYPE_NONE = 0,
    
    /* sub-type for NODE_TYPE_INTERNAL */
    SUB_TYPE_INTERNAL6 = 0x00,        // Xe+: internal node with 6 children

    /* Sub-type for NODE_TYPE_QUAD */
    SUB_TYPE_QUAD = 0,                // Xe+: standard quad leaf (64 bytes)

    /* Sub-type for NODE_TYPE_PROCEDURAL */
    SUB_TYPE_PROCEDURAL = 0,          // Xe+: standard procedural leaf
  };
}