Diligent Engine
 
Loading...
Searching...
No Matches
Diligent.IRenderDevice Struct Referenceabstract

Render device interface. More...

#include <RenderDevice.h>

Inheritance diagram for Diligent.IRenderDevice:
Diligent.IObject Diligent::IRenderDeviceD3D11 Diligent::IRenderDeviceD3D12 Diligent::IRenderDeviceGL Diligent::IRenderDeviceMtl Diligent::IRenderDeviceVk Diligent::IRenderDeviceWebGPU Diligent::ISerializationDevice Diligent::IRenderDeviceGLES

Public Member Functions

virtual void DILIGENT_CALL_TYPE CreateBuffer (const BufferDesc &BuffDesc, const BufferData *pBuffData, IBuffer **ppBuffer)=0
 Creates a new buffer object.
 
virtual void DILIGENT_CALL_TYPE CreateShader (const ShaderCreateInfo &ShaderCI, IShader **ppShader, IDataBlob **ppCompilerOutput=nullptr)=0
 Creates a new shader object.
 
virtual void DILIGENT_CALL_TYPE CreateTexture (const TextureDesc &TexDesc, const TextureData *pData, ITexture **ppTexture)=0
 Creates a new texture object.
 
virtual void DILIGENT_CALL_TYPE CreateSampler (const SamplerDesc &SamDesc, ISampler **ppSampler)=0
 Creates a new sampler object.
 
virtual void DILIGENT_CALL_TYPE CreateResourceMapping (const ResourceMappingCreateInfo &ResMappingCI, IResourceMapping **ppMapping)=0
 Creates a new resource mapping.
 
virtual void DILIGENT_CALL_TYPE CreateGraphicsPipelineState (const GraphicsPipelineStateCreateInfo &PSOCreateInfo, IPipelineState **ppPipelineState)=0
 Creates a new graphics pipeline state object.
 
virtual void DILIGENT_CALL_TYPE CreateComputePipelineState (const ComputePipelineStateCreateInfo &PSOCreateInfo, IPipelineState **ppPipelineState)=0
 Creates a new compute pipeline state object.
 
virtual void DILIGENT_CALL_TYPE CreateRayTracingPipelineState (const RayTracingPipelineStateCreateInfo &PSOCreateInfo, IPipelineState **ppPipelineState)=0
 Creates a new ray tracing pipeline state object.
 
virtual void DILIGENT_CALL_TYPE CreateTilePipelineState (const TilePipelineStateCreateInfo &PSOCreateInfo, IPipelineState **ppPipelineState)=0
 Creates a new tile pipeline state object.
 
virtual void DILIGENT_CALL_TYPE CreateFence (const FenceDesc &Desc, IFence **ppFence)=0
 Creates a new fence object.
 
virtual void DILIGENT_CALL_TYPE CreateQuery (const QueryDesc &Desc, IQuery **ppQuery)=0
 Creates a new query object.
 
virtual void DILIGENT_CALL_TYPE CreateRenderPass (const RenderPassDesc &Desc, IRenderPass **ppRenderPass)=0
 Creates a render pass object.
 
virtual void DILIGENT_CALL_TYPE CreateFramebuffer (const FramebufferDesc &Desc, IFramebuffer **ppFramebuffer)=0
 Creates a framebuffer object.
 
virtual void DILIGENT_CALL_TYPE CreateBLAS (const BottomLevelASDesc &Desc, IBottomLevelAS **ppBLAS)=0
 Creates a bottom-level acceleration structure object (BLAS).
 
virtual void DILIGENT_CALL_TYPE CreateTLAS (const TopLevelASDesc &Desc, ITopLevelAS **ppTLAS)=0
 Creates a top-level acceleration structure object (TLAS).
 
virtual void DILIGENT_CALL_TYPE CreateSBT (const ShaderBindingTableDesc &Desc, IShaderBindingTable **ppSBT)=0
 Creates a shader resource binding table object (SBT).
 
virtual void DILIGENT_CALL_TYPE CreatePipelineResourceSignature (const PipelineResourceSignatureDesc &Desc, IPipelineResourceSignature **ppSignature)=0
 Creates a pipeline resource signature object.
 
virtual void DILIGENT_CALL_TYPE CreateDeviceMemory (const DeviceMemoryCreateInfo &CreateInfo, IDeviceMemory **ppMemory)=0
 Creates a device memory object.
 
virtual void DILIGENT_CALL_TYPE CreatePipelineStateCache (const PipelineStateCacheCreateInfo &CreateInfo, IPipelineStateCache **ppPSOCache)=0
 Creates a pipeline state cache object.
 
virtual void DILIGENT_CALL_TYPE CreateDeferredContext (IDeviceContext **ppContext)=0
 Creates a deferred context.
 
virtual const RenderDeviceInfo &DILIGENT_CALL_TYPE GetDeviceInfo () const =0
 Returns the device information, see Diligent::RenderDeviceInfo for details.
 
virtual const GraphicsAdapterInfo &DILIGENT_CALL_TYPE GetAdapterInfo () const =0
 Returns the graphics adapter information, see Diligent::GraphicsAdapterInfo for details.
 
virtual const TextureFormatInfo &DILIGENT_CALL_TYPE GetTextureFormatInfo (TEXTURE_FORMAT TexFormat) const =0
 Returns the basic texture format information.
 
virtual const TextureFormatInfoExt &DILIGENT_CALL_TYPE GetTextureFormatInfoExt (TEXTURE_FORMAT TexFormat)=0
 Returns the extended texture format information.
 
virtual SparseTextureFormatInfo DILIGENT_CALL_TYPE GetSparseTextureFormatInfo (TEXTURE_FORMAT TexFormat, RESOURCE_DIMENSION Dimension, Uint32 SampleCount) const =0
 Returns the sparse texture format info for the given texture format, resource dimension and sample count.
 
virtual void DILIGENT_CALL_TYPE ReleaseStaleResources (Bool ForceRelease=false)=0
 
virtual void DILIGENT_CALL_TYPE IdleGPU ()=0
 Waits until all outstanding operations on the GPU are complete.
 
virtual IEngineFactory *DILIGENT_CALL_TYPE GetEngineFactory () const =0
 Returns engine factory this device was created from.
 
virtual IThreadPool *DILIGENT_CALL_TYPE GetShaderCompilationThreadPool () const =0
 Returns a pointer to the shader compilation thread pool.
 
void CreatePipelineState (const GraphicsPipelineStateCreateInfo &CI, IPipelineState **ppPipelineState)
 Overloaded alias for CreateGraphicsPipelineState.
 
void CreatePipelineState (const ComputePipelineStateCreateInfo &CI, IPipelineState **ppPipelineState)
 Overloaded alias for CreateComputePipelineState.
 
void CreatePipelineState (const RayTracingPipelineStateCreateInfo &CI, IPipelineState **ppPipelineState)
 Overloaded alias for CreateRayTracingPipelineState.
 
void CreatePipelineState (const TilePipelineStateCreateInfo &CI, IPipelineState **ppPipelineState)
 Overloaded alias for CreateTilePipelineState.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
 
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0
 

Detailed Description

Render device interface.

Member Function Documentation

◆ CreateBLAS()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateBLAS ( const BottomLevelASDesc & Desc,
IBottomLevelAS ** ppBLAS )
pure virtual

Creates a bottom-level acceleration structure object (BLAS).

Parameters
[in]Desc- BLAS description, see Diligent::BottomLevelASDesc for details.
[out]ppBLAS- Address of the memory location where a pointer to the BLAS interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateBuffer()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateBuffer ( const BufferDesc & BuffDesc,
const BufferData * pBuffData,
IBuffer ** ppBuffer )
pure virtual

Creates a new buffer object.

Parameters
[in]BuffDesc- Buffer description, see Diligent::BufferDesc for details.
[in]pBuffData- Pointer to Diligent::BufferData structure that describes initial buffer data or nullptr if no data is provided. Immutable buffers (USAGE_IMMUTABLE) must be initialized at creation time.
[out]ppBuffer- Address of the memory location where a pointer to the buffer interface will be written. The function calls AddRef(), so that the new buffer will have one reference and must be released by a call to Release().

Size of a uniform buffer (Diligent::BIND_UNIFORM_BUFFER) must be multiple of 16.

Stride of a formatted buffer will be computed automatically from the format if ElementByteStride member of buffer description is set to default value (0).

◆ CreateComputePipelineState()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateComputePipelineState ( const ComputePipelineStateCreateInfo & PSOCreateInfo,
IPipelineState ** ppPipelineState )
pure virtual

Creates a new compute pipeline state object.

Parameters
[in]PSOCreateInfo- Compute pipeline state create info, see Diligent::ComputePipelineStateCreateInfo for details.
[out]ppPipelineState- Address of the memory location where a pointer to the pipeline state interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateDeferredContext()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateDeferredContext ( IDeviceContext ** ppContext)
pure virtual

Creates a deferred context.

Parameters
[out]ppContext- Address of the memory location where a pointer to the deferred context interface will be written.
Remarks
Deferred contexts are not supported in OpenGL and WebGPU backends.

◆ CreateDeviceMemory()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateDeviceMemory ( const DeviceMemoryCreateInfo & CreateInfo,
IDeviceMemory ** ppMemory )
pure virtual

Creates a device memory object.

Parameters
[in]CreateInfo- Device memory create info, see Diligent::DeviceMemoryCreateInfo for details.
[out]ppMemory- Address of the memory location where a pointer to the device memory interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateFence()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateFence ( const FenceDesc & Desc,
IFence ** ppFence )
pure virtual

Creates a new fence object.

Parameters
[in]Desc- Fence description, see Diligent::FenceDesc for details.
[out]ppFence- Address of the memory location where a pointer to the fence interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateFramebuffer()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateFramebuffer ( const FramebufferDesc & Desc,
IFramebuffer ** ppFramebuffer )
pure virtual

Creates a framebuffer object.

Parameters
[in]Desc- Framebuffer description, see Diligent::FramebufferDesc for details.
[out]ppFramebuffer- Address of the memory location where a pointer to the framebuffer interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateGraphicsPipelineState()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateGraphicsPipelineState ( const GraphicsPipelineStateCreateInfo & PSOCreateInfo,
IPipelineState ** ppPipelineState )
pure virtual

Creates a new graphics pipeline state object.

Parameters
[in]PSOCreateInfo- Graphics pipeline state create info, see Diligent::GraphicsPipelineStateCreateInfo for details.
[out]ppPipelineState- Address of the memory location where a pointer to the pipeline state interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreatePipelineResourceSignature()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreatePipelineResourceSignature ( const PipelineResourceSignatureDesc & Desc,
IPipelineResourceSignature ** ppSignature )
pure virtual

Creates a pipeline resource signature object.

Parameters
[in]Desc- Resource signature description, see Diligent::PipelineResourceSignatureDesc for details.
[out]ppSignature- Address of the memory location where a pointer to the pipeline resource signature interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreatePipelineStateCache()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreatePipelineStateCache ( const PipelineStateCacheCreateInfo & CreateInfo,
IPipelineStateCache ** ppPSOCache )
pure virtual

Creates a pipeline state cache object.

Parameters
[in]CreateInfo- Pipeline state cache create info, see Diligent::PiplineStateCacheCreateInfo for details.
[out]ppPSOCache- Address of the memory location where a pointer to the pipeline state cache interface will be written. The function calls AddRef(), so that the new object will have one reference.

On devices that don't support pipeline state caches (e.g. Direct3D11, OpenGL), the method will silently do nothing.

◆ CreateQuery()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateQuery ( const QueryDesc & Desc,
IQuery ** ppQuery )
pure virtual

Creates a new query object.

Parameters
[in]Desc- Query description, see Diligent::QueryDesc for details.
[out]ppQuery- Address of the memory location where a pointer to the query interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateRayTracingPipelineState()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateRayTracingPipelineState ( const RayTracingPipelineStateCreateInfo & PSOCreateInfo,
IPipelineState ** ppPipelineState )
pure virtual

Creates a new ray tracing pipeline state object.

Parameters
[in]PSOCreateInfo- Ray tracing pipeline state create info, see Diligent::RayTracingPipelineStateCreateInfo for details.
[out]ppPipelineState- Address of the memory location where a pointer to the pipeline state interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateRenderPass()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateRenderPass ( const RenderPassDesc & Desc,
IRenderPass ** ppRenderPass )
pure virtual

Creates a render pass object.

Parameters
[in]Desc- Render pass description, see Diligent::RenderPassDesc for details.
[out]ppRenderPass- Address of the memory location where a pointer to the render pass interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateResourceMapping()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateResourceMapping ( const ResourceMappingCreateInfo & ResMappingCI,
IResourceMapping ** ppMapping )
pure virtual

Creates a new resource mapping.

Parameters
[in]ResMappingCI- Resource mapping create info, see Diligent::ResourceMappingCreateInfo for details.
[out]ppMapping- Address of the memory location where a pointer to the resource mapping interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateSampler()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateSampler ( const SamplerDesc & SamDesc,
ISampler ** ppSampler )
pure virtual

Creates a new sampler object.

Parameters
[in]SamDesc- Sampler description, see Diligent::SamplerDesc for details.
[out]ppSampler- Address of the memory location where a pointer to the sampler interface will be written. The function calls AddRef(), so that the new object will have one reference.

If an application attempts to create a sampler interface with the same attributes as an existing interface, the same interface will be returned.

In D3D11, 4096 unique sampler state objects can be created on a device at a time.

◆ CreateSBT()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateSBT ( const ShaderBindingTableDesc & Desc,
IShaderBindingTable ** ppSBT )
pure virtual

Creates a shader resource binding table object (SBT).

Parameters
[in]Desc- SBT description, see Diligent::ShaderBindingTableDesc for details.
[out]ppSBT- Address of the memory location where a pointer to the SBT interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateShader()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateShader ( const ShaderCreateInfo & ShaderCI,
IShader ** ppShader,
IDataBlob ** ppCompilerOutput = nullptr )
pure virtual

Creates a new shader object.

Parameters
[in]ShaderCI- Shader create info, see Diligent::ShaderCreateInfo for details.
[out]ppShader- Address of the memory location where a pointer to the shader interface will be written. The function calls AddRef(), so that the new object will have one reference.
[out]ppCompilerOutput- Address of the memory location where a pointer to the the compiler output data blob will be written. If null, the compiler output will be ignored.

The buffer returned in ppCompilerOutput contains two null-terminated strings. The first one is the compiler output message. The second one is the full shader source code including definitions added by the engine. The data blob object must be released by the client.

◆ CreateTexture()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateTexture ( const TextureDesc & TexDesc,
const TextureData * pData,
ITexture ** ppTexture )
pure virtual

Creates a new texture object.

Parameters
[in]TexDesc- Texture description, see Diligent::TextureDesc for details.
[in]pData- Pointer to Diligent::TextureData structure that describes initial texture data or nullptr if no data is provided. Immutable textures (USAGE_IMMUTABLE) must be initialized at creation time.
[out]ppTexture- Address of the memory location where a pointer to the texture interface will be written. The function calls AddRef(), so that the new object will have one reference.

To create all mip levels, set the TexDesc.MipLevels to zero.

Multisampled resources cannot be initialized with data when they are created.

If initial data is provided, number of subresources must exactly match the number of subresources in the texture (which is the number of mip levels times the number of array slices. For a 3D texture, this is just the number of mip levels). For example, for a 15 x 6 x 2 2D texture array, the following array of subresources should be provided:

15x6, 7x3, 3x1, 1x1, 15x6, 7x3, 3x1, 1x1.

For a 15 x 6 x 4 3D texture, the following array of subresources should be provided:

15x6x4, 7x3x2, 3x1x1, 1x1x1 

◆ CreateTilePipelineState()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateTilePipelineState ( const TilePipelineStateCreateInfo & PSOCreateInfo,
IPipelineState ** ppPipelineState )
pure virtual

Creates a new tile pipeline state object.

Parameters
[in]PSOCreateInfo- Tile pipeline state create info, see Diligent::TilePipelineStateCreateInfo for details.
[out]ppPipelineState- Address of the memory location where a pointer to the pipeline state interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ CreateTLAS()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.CreateTLAS ( const TopLevelASDesc & Desc,
ITopLevelAS ** ppTLAS )
pure virtual

Creates a top-level acceleration structure object (TLAS).

Parameters
[in]Desc- TLAS description, see Diligent::TopLevelASDesc for details.
[out]ppTLAS- Address of the memory location where a pointer to the TLAS interface will be written. The function calls AddRef(), so that the new object will have one reference.

◆ GetEngineFactory()

virtual IEngineFactory *DILIGENT_CALL_TYPE Diligent.IRenderDevice.GetEngineFactory ( ) const
pure virtual

Returns engine factory this device was created from.

This method does not increment the reference counter of the returned interface, so an application must not call Release().

◆ GetShaderCompilationThreadPool()

virtual IThreadPool *DILIGENT_CALL_TYPE Diligent.IRenderDevice.GetShaderCompilationThreadPool ( ) const
pure virtual

Returns a pointer to the shader compilation thread pool.

This method does not increment the reference counter of the returned interface, so an application must not call Release().

◆ GetTextureFormatInfo()

virtual const TextureFormatInfo &DILIGENT_CALL_TYPE Diligent.IRenderDevice.GetTextureFormatInfo ( TEXTURE_FORMAT TexFormat) const
pure virtual

Returns the basic texture format information.

See Diligent::TextureFormatInfo for details on the provided information.

Parameters
[in]TexFormat- Texture format for which to provide the information
Returns
Const reference to the TextureFormatInfo structure containing the texture format description.
Remarks
This method must be externally synchronized.

◆ GetTextureFormatInfoExt()

virtual const TextureFormatInfoExt &DILIGENT_CALL_TYPE Diligent.IRenderDevice.GetTextureFormatInfoExt ( TEXTURE_FORMAT TexFormat)
pure virtual

Returns the extended texture format information.

See Diligent::TextureFormatInfoExt for details on the provided information.

Parameters
[in]TexFormat- Texture format for which to provide the information
Returns
Const reference to the TextureFormatInfoExt structure containing the extended texture format description.

The first time this method is called for a particular format, it may be considerably slower than GetTextureFormatInfo(). If you do not require extended information, call GetTextureFormatInfo() instead.

Remarks
This method must be externally synchronized.

◆ IdleGPU()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.IdleGPU ( )
pure virtual

Waits until all outstanding operations on the GPU are complete.

Note
The method blocks the execution of the calling thread until the GPU is idle.

The method does not flush immediate contexts, so it will only wait for commands that the contexts using IDeviceContext::Flush() if it needs to make sure all recorded commands have been previously submitted for execution. An application should explicitly flush are complete when the method returns.

◆ ReleaseStaleResources()

virtual void DILIGENT_CALL_TYPE Diligent.IRenderDevice.ReleaseStaleResources ( Bool ForceRelease = false)
pure virtual

Purges device release queues and releases all stale resources. This method is automatically called by ISwapChain::Present() of the primary swap chain.

Parameters
[in]ForceRelease- Forces release of all objects. Use this option with great care only if you are sure the resources are not in use by the GPU (such as when the device has just been idled).