Diligent Engine  v.2.4.g
RenderDevice.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 "EngineFactory.h"
35 #include "GraphicsTypes.h"
36 #include "Constants.h"
37 #include "Buffer.h"
38 #include "InputLayout.h"
39 #include "Shader.h"
40 #include "Texture.h"
41 #include "Sampler.h"
42 #include "ResourceMapping.h"
43 #include "TextureView.h"
44 #include "BufferView.h"
45 #include "PipelineState.h"
46 #include "Fence.h"
47 #include "Query.h"
48 #include "RenderPass.h"
49 #include "Framebuffer.h"
50 #include "BottomLevelAS.h"
51 #include "TopLevelAS.h"
52 #include "ShaderBindingTable.h"
54 
55 #include "DepthStencilState.h"
56 #include "RasterizerState.h"
57 #include "BlendState.h"
58 
60 
61 // {F0E9B607-AE33-4B2B-B1AF-A8B2C3104022}
62 static const INTERFACE_ID IID_RenderDevice =
63  {0xf0e9b607, 0xae33, 0x4b2b, {0xb1, 0xaf, 0xa8, 0xb2, 0xc3, 0x10, 0x40, 0x22}};
64 
65 #define DILIGENT_INTERFACE_NAME IRenderDevice
66 #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
67 
68 #define IRenderDeviceInclusiveMethods \
69  IObjectInclusiveMethods; \
70  IRenderDeviceMethods RenderDevice
71 
72 // clang-format off
73 
76 {
78 
92  VIRTUAL void METHOD(CreateBuffer)(THIS_
93  const BufferDesc REF BuffDesc,
94  const BufferData* pBuffData,
95  IBuffer** ppBuffer) PURE;
96 
98 
104  VIRTUAL void METHOD(CreateShader)(THIS_
105  const ShaderCreateInfo REF ShaderCI,
106  IShader** ppShader) PURE;
107 
109 
130  VIRTUAL void METHOD(CreateTexture)(THIS_
131  const TextureDesc REF TexDesc,
132  const TextureData* pData,
133  ITexture** ppTexture) PURE;
134 
136 
145  VIRTUAL void METHOD(CreateSampler)(THIS_
146  const SamplerDesc REF SamDesc,
147  ISampler** ppSampler) PURE;
148 
150 
156  VIRTUAL void METHOD(CreateResourceMapping)(THIS_
157  const ResourceMappingDesc REF MappingDesc,
158  IResourceMapping** ppMapping) PURE;
159 
161 
167  VIRTUAL void METHOD(CreateGraphicsPipelineState)(THIS_
168  const GraphicsPipelineStateCreateInfo REF PSOCreateInfo,
169  IPipelineState** ppPipelineState) PURE;
170 
172 
178  VIRTUAL void METHOD(CreateComputePipelineState)(THIS_
179  const ComputePipelineStateCreateInfo REF PSOCreateInfo,
180  IPipelineState** ppPipelineState) PURE;
181 
183 
189  VIRTUAL void METHOD(CreateRayTracingPipelineState)(THIS_
190  const RayTracingPipelineStateCreateInfo REF PSOCreateInfo,
191  IPipelineState** ppPipelineState) PURE;
192 
194 
200  VIRTUAL void METHOD(CreateFence)(THIS_
201  const FenceDesc REF Desc,
202  IFence** ppFence) PURE;
203 
204 
206 
212  VIRTUAL void METHOD(CreateQuery)(THIS_
213  const QueryDesc REF Desc,
214  IQuery** ppQuery) PURE;
215 
216 
218 
224  VIRTUAL void METHOD(CreateRenderPass)(THIS_
225  const RenderPassDesc REF Desc,
226  IRenderPass** ppRenderPass) PURE;
227 
228 
229 
231 
237  VIRTUAL void METHOD(CreateFramebuffer)(THIS_
238  const FramebufferDesc REF Desc,
239  IFramebuffer** ppFramebuffer) PURE;
240 
241 
243 
249  VIRTUAL void METHOD(CreateBLAS)(THIS_
250  const BottomLevelASDesc REF Desc,
251  IBottomLevelAS** ppBLAS) PURE;
252 
253 
255 
261  VIRTUAL void METHOD(CreateTLAS)(THIS_
262  const TopLevelASDesc REF Desc,
263  ITopLevelAS** ppTLAS) PURE;
264 
265 
267 
273  VIRTUAL void METHOD(CreateSBT)(THIS_
274  const ShaderBindingTableDesc REF Desc,
275  IShaderBindingTable** ppSBT) PURE;
276 
278 
284  VIRTUAL void METHOD(CreatePipelineResourceSignature)(THIS_
286  IPipelineResourceSignature** ppSignature) PURE;
287 
288 
290  VIRTUAL const DeviceCaps REF METHOD(GetDeviceCaps)(THIS) CONST PURE;
291 
293  VIRTUAL const DeviceProperties REF METHOD(GetDeviceProperties)(THIS) CONST PURE;
294 
295 
297 
302  VIRTUAL const TextureFormatInfo REF METHOD(GetTextureFormatInfo)(THIS_
303  TEXTURE_FORMAT TexFormat) PURE;
304 
305 
307 
315  VIRTUAL const TextureFormatInfoExt REF METHOD(GetTextureFormatInfoExt)(THIS_
316  TEXTURE_FORMAT TexFormat) PURE;
317 
323  VIRTUAL void METHOD(ReleaseStaleResources)(THIS_
324  bool ForceRelease DEFAULT_VALUE(false)) PURE;
325 
326 
328 
335  VIRTUAL void METHOD(IdleGPU)(THIS) PURE;
336 
337 
341  VIRTUAL IEngineFactory* METHOD(GetEngineFactory)(THIS) CONST PURE;
342 };
344 
345 #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h"
346 
347 #if DILIGENT_C_INTERFACE
348 
349 // clang-format off
350 # define IRenderDevice_CreateBuffer(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateBuffer, This, __VA_ARGS__)
351 # define IRenderDevice_CreateShader(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateShader, This, __VA_ARGS__)
352 # define IRenderDevice_CreateTexture(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateTexture, This, __VA_ARGS__)
353 # define IRenderDevice_CreateSampler(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateSampler, This, __VA_ARGS__)
354 # define IRenderDevice_CreateResourceMapping(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateResourceMapping, This, __VA_ARGS__)
355 # define IRenderDevice_CreateGraphicsPipelineState(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateGraphicsPipelineState, This, __VA_ARGS__)
356 # define IRenderDevice_CreateComputePipelineState(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateComputePipelineState, This, __VA_ARGS__)
357 # define IRenderDevice_CreateRayTracingPipelineState(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateRayTracingPipelineState, This, __VA_ARGS__)
358 # define IRenderDevice_CreateFence(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateFence, This, __VA_ARGS__)
359 # define IRenderDevice_CreateQuery(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateQuery, This, __VA_ARGS__)
360 # define IRenderDevice_CreateRenderPass(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateRenderPass, This, __VA_ARGS__)
361 # define IRenderDevice_CreateFramebuffer(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateFramebuffer, This, __VA_ARGS__)
362 # define IRenderDevice_CreateBLAS(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateBLAS, This, __VA_ARGS__)
363 # define IRenderDevice_CreateTLAS(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateTLAS, This, __VA_ARGS__)
364 # define IRenderDevice_CreateSBT(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateSBT, This, __VA_ARGS__)
365 # define IRenderDevice_CreatePipelineResourceSignature(This, ...) CALL_IFACE_METHOD(RenderDevice, CreatePipelineResourceSignature, This, __VA_ARGS__)
366 # define IRenderDevice_GetDeviceCaps(This) CALL_IFACE_METHOD(RenderDevice, GetDeviceCaps, This)
367 # define IRenderDevice_GetTextureFormatInfo(This, ...) CALL_IFACE_METHOD(RenderDevice, GetTextureFormatInfo, This, __VA_ARGS__)
368 # define IRenderDevice_GetTextureFormatInfoExt(This, ...) CALL_IFACE_METHOD(RenderDevice, GetTextureFormatInfoExt, This, __VA_ARGS__)
369 # define IRenderDevice_ReleaseStaleResources(This, ...) CALL_IFACE_METHOD(RenderDevice, ReleaseStaleResources, This, __VA_ARGS__)
370 # define IRenderDevice_IdleGPU(This) CALL_IFACE_METHOD(RenderDevice, IdleGPU, This)
371 # define IRenderDevice_GetEngineFactory(This) CALL_IFACE_METHOD(RenderDevice, GetEngineFactory, This)
372 // clang-format on
373 
374 #endif
375 
376 DILIGENT_END_NAMESPACE // namespace Diligent
Texture.h
TopLevelAS.h
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
TextureView.h
Diligent::GraphicsPipelineStateCreateInfo
Graphics pipeline state creation attributes.
Definition: PipelineState.h:397
Diligent::SamplerDesc
Sampler description.
Definition: Sampler.h:58
Diligent::TextureFormatInfoExt
Extended texture format information.
Definition: GraphicsTypes.h:2595
Diligent::ISampler
Texture sampler interface.
Definition: Sampler.h:192
Diligent::RayTracingPipelineStateCreateInfo
Ray tracing pipeline state description.
Definition: PipelineState.h:443
Diligent::IPipelineResourceSignature
Pipeline resource signature interface.
Definition: PipelineResourceSignature.h:226
Diligent::PipelineResourceSignatureDesc
Pipeline resource signature description.
Definition: PipelineResourceSignature.h:166
PipelineResourceSignature.h
Diligent::IShaderBindingTable
Shader binding table interface.
Definition: ShaderBindingTable.h:93
Diligent::TopLevelASDesc
Top-level AS description.
Definition: TopLevelAS.h:49
Diligent::IPipelineState
Pipeline state interface.
Definition: PipelineState.h:505
DILIGENT_BEGIN_INTERFACE
#define DILIGENT_BEGIN_INTERFACE(Name, Base)
Definition: CommonDefinitions.h:97
Diligent::QueryDesc
Query description.
Definition: Query.h:150
Shader.h
Diligent::IShader
Shader interface.
Definition: Shader.h:428
Diligent::IObject
Base interface for all dynamic objects in the engine.
Definition: Object.h:41
Diligent::ITopLevelAS
Top-level AS interface.
Definition: TopLevelAS.h:151
Diligent::IFramebuffer
Framebuffer interface.
Definition: Framebuffer.h:73
Diligent::ResourceMappingDesc
Resource mapping description.
Definition: ResourceMapping.h:75
Query.h
Diligent::RenderPassDesc
Render pass description.
Definition: RenderPass.h:341
THIS
#define THIS
Definition: DefineInterfaceHelperMacros.h:81
Constants.h
Diligent::ShaderCreateInfo
Shader creation attributes.
Definition: Shader.h:241
Diligent::IBuffer
Buffer interface.
Definition: Buffer.h:187
PURE
#define PURE
Definition: DefineInterfaceHelperMacros.h:85
Diligent::ShaderBindingTableDesc
Shader binding table description.
Definition: ShaderBindingTable.h:50
ShaderBindingTable.h
Diligent::IRenderDevice
Render device interface.
Definition: RenderDevice.h:75
BlendState.h
Diligent::TextureDesc
Texture description.
Definition: Texture.h:47
DILIGENT_END_NAMESPACE
#define DILIGENT_END_NAMESPACE
Definition: CommonDefinitions.h:86
RasterizerState.h
InputLayout.h
CONST
#define CONST
Definition: DefineInterfaceHelperMacros.h:84
Diligent::DeviceProperties
Device properties.
Definition: GraphicsTypes.h:1970
ResourceMapping.h
Diligent::TextureData
Describes the initial data to store in the texture.
Definition: Texture.h:221
Diligent::ComputePipelineStateCreateInfo
Compute pipeline state description.
Definition: PipelineState.h:427
Buffer.h
RenderPass.h
Diligent::TextureFormatInfo
Basic texture format description.
Definition: GraphicsTypes.h:2548
PipelineState.h
BufferView.h
Diligent::TEXTURE_FORMAT
TEXTURE_FORMAT
Texture formats.
Definition: GraphicsTypes.h:328
Diligent::BufferDesc
Buffer description.
Definition: Buffer.h:74
REF
#define REF
Definition: DefineGlobalFuncHelperMacros.h:39
METHOD
#define METHOD(Name)
Definition: DefineInterfaceHelperMacros.h:87
DEFAULT_VALUE
#define DEFAULT_VALUE(x)
Definition: CommonDefinitions.h:99
Diligent::DeviceCaps
Device capabilities.
Definition: GraphicsTypes.h:1833
Diligent::IFence
Fence interface.
Definition: Fence.h:62
EngineFactory.h
DepthStencilState.h
Diligent::IQuery
Query interface.
Definition: Query.h:177
Diligent::FramebufferDesc
Framebuffer description.
Definition: Framebuffer.h:46
DILIGENT_BEGIN_NAMESPACE
#define DILIGENT_BEGIN_NAMESPACE(Name)
Definition: CommonDefinitions.h:82
GraphicsTypes.h
Diligent::IBottomLevelAS
Bottom-level AS interface.
Definition: BottomLevelAS.h:207
Framebuffer.h
Sampler.h
Fence.h
Diligent::BufferData
Describes the buffer initial data.
Definition: Buffer.h:155
Diligent::BottomLevelASDesc
Bottom-level AS description.
Definition: BottomLevelAS.h:145
Diligent::IEngineFactory
Engine factory base interface.
Definition: EngineFactory.h:60
Diligent::FenceDesc
Fence description.
Definition: Fence.h:43
Diligent::ITexture
Texture inteface.
Definition: Texture.h:273
Diligent::IRenderPass
Render pass interface.
Definition: RenderPass.h:369
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
THIS_
#define THIS_
Definition: DefineInterfaceHelperMacros.h:82
Diligent::IResourceMapping
Resouce mapping.
Definition: ResourceMapping.h:107
BottomLevelAS.h