Diligent Engine  v.2.4.g
BottomLevelAS.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
32 
33 #include "../../../Primitives/interface/Object.h"
34 #include "../../../Primitives/interface/FlagEnum.h"
35 #include "GraphicsTypes.h"
36 #include "Constants.h"
37 #include "Buffer.h"
38 
40 
41 // {E56F5755-FE5E-496C-BFA7-BCD535360FF7}
42 static const INTERFACE_ID IID_BottomLevelAS =
43  {0xe56f5755, 0xfe5e, 0x496c, {0xbf, 0xa7, 0xbc, 0xd5, 0x35, 0x36, 0xf, 0xf7}};
44 
45 // clang-format off
46 
47 static const Uint32 INVALID_INDEX = ~0u;
48 
49 
51 
54 {
57  const char* GeometryName DEFAULT_INITIALIZER(nullptr);
58 
61  Uint32 MaxVertexCount DEFAULT_INITIALIZER(0);
62 
68 
72  Uint8 VertexComponentCount DEFAULT_INITIALIZER(0);
73 
76  Uint32 MaxPrimitiveCount DEFAULT_INITIALIZER(0);
77 
82 
84  Bool AllowsTransforms DEFAULT_INITIALIZER(False);
85 
86 #if DILIGENT_CPP_INTERFACE
87  BLASTriangleDesc() noexcept {}
88 #endif
89 };
91 
92 
94 
97 {
100  const char* GeometryName DEFAULT_INITIALIZER(nullptr);
101 
104  Uint32 MaxBoxCount DEFAULT_INITIALIZER(0);
105 
106 #if DILIGENT_CPP_INTERFACE
107  BLASBoundingBoxDesc() noexcept {}
108 #endif
109 };
111 
112 
115 {
117 
122 
128 
131 
134 
138 
140 };
142 
143 
146 
148  const BLASTriangleDesc* pTriangles DEFAULT_INITIALIZER(nullptr);
149 
151  Uint32 TriangleCount DEFAULT_INITIALIZER(0);
152 
154  const BLASBoundingBoxDesc* pBoxes DEFAULT_INITIALIZER(nullptr);
155 
158 
161 
164  Uint32 CompactedSize DEFAULT_INITIALIZER(0);
165 
167  Uint64 CommandQueueMask DEFAULT_INITIALIZER(1);
168 
169 #if DILIGENT_CPP_INTERFACE
170  BottomLevelASDesc() noexcept {}
171 #endif
172 };
174 
175 
178 {
183 
189 
190 #if DILIGENT_CPP_INTERFACE
191  ScratchBufferSizes() noexcept {}
192 #endif
193 };
195 
196 
197 #define DILIGENT_INTERFACE_NAME IBottomLevelAS
198 #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
199 
200 #define IBottomLevelASInclusiveMethods \
201  IDeviceObjectInclusiveMethods; \
202  IBottomLevelASMethods BottomLevelAS
203 
205 
208 {
209 #if DILIGENT_CPP_INTERFACE
210  virtual const BottomLevelASDesc& DILIGENT_CALL_TYPE GetDesc() const override = 0;
212 #endif
213 
215 
220  VIRTUAL Uint32 METHOD(GetGeometryDescIndex)(THIS_
221  const char* Name) CONST PURE;
222 
223 
225 
230  VIRTUAL Uint32 METHOD(GetGeometryIndex)(THIS_
231  const char* Name) CONST PURE;
232 
233 
236 
240  VIRTUAL Uint32 METHOD(GetActualGeometryCount)(THIS) CONST PURE;
241 
242 
244 
246  VIRTUAL ScratchBufferSizes METHOD(GetScratchBufferSizes)(THIS) CONST PURE;
247 
248 
250 
253  VIRTUAL void* METHOD(GetNativeHandle)(THIS) PURE;
254 
255 
257 
263  VIRTUAL void METHOD(SetState)(THIS_
264  RESOURCE_STATE State) PURE;
265 
266 
269 };
271 
272 #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h"
273 
274 #if DILIGENT_C_INTERFACE
275 
276 // clang-format off
277 
278 # define IBottomLevelAS_GetGeometryDescIndex(This, ...) CALL_IFACE_METHOD(BottomLevelAS, GetGeometryDescIndex, This, __VA_ARGS__)
279 # define IBottomLevelAS_GetGeometryIndex(This, ...) CALL_IFACE_METHOD(BottomLevelAS, GetGeometryIndex, This, __VA_ARGS__)
280 # define IBottomLevelAS_GetActualGeometryCount(This) CALL_IFACE_METHOD(BottomLevelAS, GetActualGeometryCount, This)
281 # define IBottomLevelAS_GetScratchBufferSizes(This) CALL_IFACE_METHOD(BottomLevelAS, GetScratchBufferSizes, This)
282 # define IBottomLevelAS_GetNativeHandle(This) CALL_IFACE_METHOD(BottomLevelAS, GetNativeHandle, This)
283 # define IBottomLevelAS_SetState(This, ...) CALL_IFACE_METHOD(BottomLevelAS, SetState, This, __VA_ARGS__)
284 # define IBottomLevelAS_GetState(This) CALL_IFACE_METHOD(BottomLevelAS, GetState, This)
285 
286 // clang-format on
287 
288 #endif
289 
290 DILIGENT_END_NAMESPACE // namespace Diligent
DILIGENT_END_INTERFACE
#define DILIGENT_END_INTERFACE
Definition: DefineInterfaceHelperMacros.h:88
Diligent::INTERFACE_ID
struct INTERFACE_ID INTERFACE_ID
Definition: InterfaceID.h:54
VIRTUAL
#define VIRTUAL
Definition: DefineInterfaceHelperMacros.h:83
Diligent::BLASTriangleDesc
Defines bottom level acceleration structure triangles description.
Definition: BottomLevelAS.h:53
DILIGENT_BEGIN_INTERFACE
#define DILIGENT_BEGIN_INTERFACE(Name, Base)
Definition: CommonDefinitions.h:97
Flags
Uint32 Flags
Definition: DXBCUtils.cpp:71
Diligent::Uint64
uint64_t Uint64
64-bit unsigned integer
Definition: BasicTypes.h:50
Diligent::ScratchBufferSizes
Defines the scratch buffer info for acceleration structure.
Definition: BottomLevelAS.h:177
Diligent::RAYTRACING_BUILD_AS_ALLOW_UPDATE
@ RAYTRACING_BUILD_AS_ALLOW_UPDATE
Indicates that the specified acceleration structure can be updated via IDeviceContext::BuildBLAS() or...
Definition: BottomLevelAS.h:121
Diligent::VT_UNDEFINED
@ VT_UNDEFINED
Undefined type.
Definition: GraphicsTypes.h:51
Diligent::DeviceObjectAttribs
struct DeviceObjectAttribs DeviceObjectAttribs
Definition: GraphicsTypes.h:1212
Diligent::IDeviceObject
Base interface for all objects created by the render device Diligent::IRenderDevice.
Definition: DeviceObject.h:52
Diligent::RAYTRACING_BUILD_AS_NONE
@ RAYTRACING_BUILD_AS_NONE
Definition: BottomLevelAS.h:116
Diligent::BottomLevelASDesc::BottomLevelASDesc
BottomLevelASDesc() noexcept
Definition: BottomLevelAS.h:170
THIS
#define THIS
Definition: DefineInterfaceHelperMacros.h:81
Constants.h
PURE
#define PURE
Definition: DefineInterfaceHelperMacros.h:85
Diligent::RAYTRACING_BUILD_AS_ALLOW_COMPACTION
@ RAYTRACING_BUILD_AS_ALLOW_COMPACTION
Indicates that the specified acceleration structure can act as the source for a copy acceleration str...
Definition: BottomLevelAS.h:127
Diligent::ScratchBufferSizes::ScratchBufferSizes
ScratchBufferSizes() noexcept
Definition: BottomLevelAS.h:191
Diligent::RAYTRACING_BUILD_AS_FLAGS_LAST
@ RAYTRACING_BUILD_AS_FLAGS_LAST
Definition: BottomLevelAS.h:139
DILIGENT_END_NAMESPACE
#define DILIGENT_END_NAMESPACE
Definition: CommonDefinitions.h:86
Diligent::VALUE_TYPE
VALUE_TYPE
Value type.
Definition: GraphicsTypes.h:49
CONST
#define CONST
Definition: DefineInterfaceHelperMacros.h:84
Diligent::BLASBoundingBoxDesc::BLASBoundingBoxDesc
BLASBoundingBoxDesc() noexcept
Definition: BottomLevelAS.h:107
Diligent::BLASTriangleDesc::BLASTriangleDesc
BLASTriangleDesc() noexcept
Definition: BottomLevelAS.h:87
DILIGENT_DERIVE
#define DILIGENT_DERIVE(TypeName)
Definition: CommonDefinitions.h:90
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Buffer.h
DEFAULT_INITIALIZER
#define DEFAULT_INITIALIZER(x)
Definition: CommonDefinitions.h:93
Diligent::RAYTRACING_BUILD_AS_PREFER_FAST_BUILD
@ RAYTRACING_BUILD_AS_PREFER_FAST_BUILD
Indicates that the given acceleration structure build should prioritize build time over trace perform...
Definition: BottomLevelAS.h:133
Diligent::Bool
bool Bool
Boolean.
Definition: BasicTypes.h:59
Diligent::RAYTRACING_BUILD_AS_FLAGS
RAYTRACING_BUILD_AS_FLAGS
Defines acceleration structures build flags.
Definition: BottomLevelAS.h:114
Diligent::BottomLevelASDesc
struct BottomLevelASDesc BottomLevelASDesc
Definition: BottomLevelAS.h:173
Diligent::RAYTRACING_BUILD_AS_LOW_MEMORY
@ RAYTRACING_BUILD_AS_LOW_MEMORY
Indicates that this acceleration structure should minimize the size of the scratch memory and the fin...
Definition: BottomLevelAS.h:137
Diligent::RAYTRACING_BUILD_AS_PREFER_FAST_TRACE
@ RAYTRACING_BUILD_AS_PREFER_FAST_TRACE
Indicates that the given acceleration structure build should prioritize trace performance over build ...
Definition: BottomLevelAS.h:130
METHOD
#define METHOD(Name)
Definition: DefineInterfaceHelperMacros.h:87
DILIGENT_TYPED_ENUM
#define DILIGENT_TYPED_ENUM(EnumName, EnumType)
Definition: CommonDefinitions.h:88
Diligent::Uint8
uint8_t Uint8
8-bit unsigned integer
Definition: BasicTypes.h:53
DILIGENT_BEGIN_NAMESPACE
#define DILIGENT_BEGIN_NAMESPACE(Name)
Definition: CommonDefinitions.h:82
GraphicsTypes.h
Diligent::IBottomLevelAS
Bottom-level AS interface.
Definition: BottomLevelAS.h:207
DEFINE_FLAG_ENUM_OPERATORS
DEFINE_FLAG_ENUM_OPERATORS(FILE_DIALOG_FLAGS)
Diligent::RESOURCE_STATE
RESOURCE_STATE
Resource usage state.
Definition: GraphicsTypes.h:2814
Diligent::BottomLevelASDesc
Bottom-level AS description.
Definition: BottomLevelAS.h:145
Diligent::BLASBoundingBoxDesc
Defines bottom level acceleration structure axis-aligned bounding boxes description.
Definition: BottomLevelAS.h:96
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
THIS_
#define THIS_
Definition: DefineInterfaceHelperMacros.h:82