RavEngine
Loading...
Searching...
No Matches
NvFlowShaderTypes.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2014-2022 NVIDIA Corporation. All rights reserved.
26
27
28#ifndef NV_FLOW_SHADER_TYPES_H
29#define NV_FLOW_SHADER_TYPES_H
30
31#ifndef NV_FLOW_CPU
32#if defined(__cplusplus)
33#define NV_FLOW_CPU 1
34#endif
35#endif
36
37#ifdef NV_FLOW_CPU_SHADER
38
39// For CPU Shader, basic types defined at global scope before shader
40
41#elif defined(NV_FLOW_CPU)
42
43typedef unsigned int NvFlowBool32;
44typedef unsigned int NvFlowUint;
45typedef unsigned char NvFlowUint8;
46typedef unsigned short NvFlowUint16;
47typedef unsigned long long NvFlowUint64;
48
49typedef struct NvFlowUint2
50{
51 NvFlowUint x, y;
52}NvFlowUint2;
53
54typedef struct NvFlowUint3
55{
56 NvFlowUint x, y, z;
57}NvFlowUint3;
58
59typedef struct NvFlowUint4
60{
61 NvFlowUint x, y, z, w;
62}NvFlowUint4;
63
64typedef struct NvFlowInt2
65{
66 int x, y;
67}NvFlowInt2;
68
69typedef struct NvFlowInt3
70{
71 int x, y, z;
72}NvFlowInt3;
73
74typedef struct NvFlowInt4
75{
76 int x, y, z, w;
77}NvFlowInt4;
78
79typedef struct NvFlowFloat2
80{
81 float x, y;
82}NvFlowFloat2;
83
84typedef struct NvFlowFloat3
85{
86 float x, y, z;
87}NvFlowFloat3;
88
89typedef struct NvFlowFloat4
90{
91 float x, y, z, w;
92}NvFlowFloat4;
93
94typedef struct NvFlowFloat4x4
95{
96 NvFlowFloat4 x, y, z, w;
97}NvFlowFloat4x4;
98
99#else
100
101#define NvFlowUint uint
102#define NvFlowUint2 uint2
103#define NvFlowUint3 uint3
104#define NvFlowUint4 uint4
105#define NvFlowInt2 int2
106#define NvFlowInt3 int3
107#define NvFlowInt4 int4
108#define NvFlowFloat2 float2
109#define NvFlowFloat3 float3
110#define NvFlowFloat4 float4
111#define NvFlowFloat4x4 float4x4
112#define NvFlowBool32 uint
113
114#endif
115
117{
118 NvFlowUint3 blockDimLessOne;
119 NvFlowUint threadsPerBlock;
120
121 NvFlowUint3 blockDimBits;
122 NvFlowUint numLocations;
123
124 NvFlowUint3 tableDimLessOne;
125 NvFlowUint tableDim3;
126
127 NvFlowUint tableDimBits_x;
128 NvFlowUint tableDimBits_xy;
129 NvFlowUint tableDimBits_z;
130 NvFlowUint locationOffset;
131
132 NvFlowUint allocationOffset;
133 NvFlowUint newListOffset;
134 NvFlowUint blockLevelOffsetGlobal;
135 NvFlowUint blockLevelOffsetLocal;
136
137 NvFlowUint layerParamIdxOffset;
138 NvFlowUint numLayers;
139 NvFlowUint pad0;
140 NvFlowUint pad1;
141
142 NvFlowUint3 dim;
143 NvFlowUint maxLocations;
144 NvFlowFloat3 dimInv;
145 NvFlowUint numNewLocations;
146
147 NvFlowInt4 globalLocationMin;
148 NvFlowInt4 globalLocationMax;
149};
150#ifdef NV_FLOW_CPU
152#endif
153
155{
156 NvFlowFloat3 blockSizeWorld;
157 float blockSizeWorld3;
158 NvFlowFloat3 blockSizeWorldInv;
159 int layer;
160 NvFlowInt4 locationMin;
161 NvFlowInt4 locationMax;
162 NvFlowFloat3 worldMin;
163 NvFlowUint forceClear;
164 NvFlowFloat3 worldMax;
165 NvFlowUint forceDisableEmitters;
166 NvFlowUint numLocations;
167 float deltaTime;
168 NvFlowUint forceDisableCoreSimulation;
169 NvFlowUint gridReset;
170};
171#ifdef NV_FLOW_CPU
173#endif
174
176{
177 NvFlowUint2 nanovdb_size_without_leaves;
178 NvFlowUint2 nanovdb_size_with_leaves;
179
180 NvFlowUint2 list_tile_offset;
181 NvFlowUint2 list_upper_offset;
182 NvFlowUint2 list_lower_offset;
183 NvFlowUint2 list_leaf_offset;
184
185 NvFlowUint2 cache_tile_offset;
186 NvFlowUint2 cache_upper_offset;
187 NvFlowUint2 cache_lower_offset;
188 NvFlowUint2 cache_leaf_offset;
189
190 NvFlowUint list_tile_count;
191 NvFlowUint list_upper_count;
192 NvFlowUint list_lower_count;
193 NvFlowUint list_leaf_count;
194
195 NvFlowUint cache_tile_count;
196 NvFlowUint cache_upper_count;
197 NvFlowUint cache_lower_count;
198 NvFlowUint cache_leaf_count;
199
200 NvFlowUint2 cache_size;
201 NvFlowUint grid_count;
202 NvFlowUint grid_type;
203
204 NvFlowUint3 subGridDimLessOne;
205 NvFlowUint pad3;
206 NvFlowUint3 subGridDimBits;
207 NvFlowUint pad4;
208};
209#ifdef NV_FLOW_CPU
211#endif
212
213#endif
Definition NvFlowShaderTypes.h:155
Definition NvFlowShaderTypes.h:117
Definition NvFlowShaderTypes.h:176