1 // Copyright 2019-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #if __cplusplus >= 201103L
7 #include <cstdint>
8 #endif
9 
10 // this header is shared with ISPC
11 
12 // An enum type that represensts the different data types represented in openvkl
13 //
14 // IMPORTANT: enums added here should also be represented in stringForType() and
15 // other functions in VKLCommon.cpp!
16 #if __cplusplus >= 201103L
17 typedef enum : uint32_t
18 #else
19 typedef enum
20 #endif
21 {
22   // Driver reference type.
23   VKL_DEVICE = 100,
24 
25   // Void pointer type.
26   VKL_VOID_PTR = 200,
27 
28   // Booleans, same size as VKL_INT.
29   VKL_BOOL = 250,
30 
31   // highest bit to represent objects/handles
32   VKL_OBJECT = 0x8000000,
33 
34   // Object reference subtypes.
35   VKL_DATA = 0x8000000 + 100,
36   VKL_VOLUME,
37 
38   // Pointer to a C-style NULL-terminated character string.
39   VKL_STRING = 1500,
40 
41   // Character scalar and vector types.
42   VKL_CHAR = 2000,
43   VKL_VEC2C,
44   VKL_VEC3C,
45   VKL_VEC4C,
46 
47   // Unsigned character scalar and vector types.
48   VKL_UCHAR = 2500,
49   VKL_VEC2UC,
50   VKL_VEC3UC,
51   VKL_VEC4UC,
52   VKL_BYTE = 2500,  // XXX VKL_UCHAR, ISPC issue #1246
53   VKL_RAW  = 2500,  // XXX VKL_UCHAR, ISPC issue #1246
54 
55   // Signed 16-bit integer scalar and vector types.
56   VKL_SHORT = 3000,
57   VKL_VEC2S,
58   VKL_VEC3S,
59   VKL_VEC4S,
60 
61   // Unsigned 16-bit integer scalar and vector types.
62   VKL_USHORT = 3500,
63   VKL_VEC2US,
64   VKL_VEC3US,
65   VKL_VEC4US,
66 
67   // Signed 32-bit integer scalar and vector types.
68   VKL_INT = 4000,
69   VKL_VEC2I,
70   VKL_VEC3I,
71   VKL_VEC4I,
72 
73   // Unsigned 32-bit integer scalar and vector types.
74   VKL_UINT = 4500,
75   VKL_VEC2UI,
76   VKL_VEC3UI,
77   VKL_VEC4UI,
78 
79   // Signed 64-bit integer scalar and vector types.
80   VKL_LONG = 5000,
81   VKL_VEC2L,
82   VKL_VEC3L,
83   VKL_VEC4L,
84 
85   // Unsigned 64-bit integer scalar and vector types.
86   VKL_ULONG = 5550,
87   VKL_VEC2UL,
88   VKL_VEC3UL,
89   VKL_VEC4UL,
90 
91   // Half-precision floating-point scalar and vector types (IEEE 754
92   // `binary16`).
93   VKL_HALF = 5800,
94   VKL_VEC2H,
95   VKL_VEC3H,
96   VKL_VEC4H,
97 
98   // Single precision floating point scalar and vector types.
99   VKL_FLOAT = 6000,
100   VKL_VEC2F,
101   VKL_VEC3F,
102   VKL_VEC4F,
103 
104   // Double precision floating point scalar and vector types.
105   VKL_DOUBLE = 7000,
106   VKL_VEC2D,
107   VKL_VEC3D,
108   VKL_VEC4D,
109 
110   // Signed 32-bit integer N-dimensional box types
111   VKL_BOX1I = 8000,
112   VKL_BOX2I,
113   VKL_BOX3I,
114   VKL_BOX4I,
115 
116   // Single precision floating point N-dimensional box types
117   VKL_BOX1F = 10000,
118   VKL_BOX2F,
119   VKL_BOX3F,
120   VKL_BOX4F,
121 
122   // Transformation types
123   VKL_LINEAR2F = 12000,
124   VKL_LINEAR3F,
125   VKL_AFFINE2F,
126   VKL_AFFINE3F,
127 
128   // Guard value.
129   VKL_UNKNOWN = 9999999
130 } VKLDataType;
131