Diligent Engine API Reference
|
Device context interface. More...
Public Member Functions | |
virtual void | QueryInterface (const Diligent::INTERFACE_ID &IID, IObject **ppInterface)=0 |
Queries the specific interface, see IObject::QueryInterface() for details. | |
virtual void | SetPipelineState (IPipelineState *pPipelineState)=0 |
Sets the pipeline state. More... | |
virtual void | TransitionShaderResources (IPipelineState *pPipelineState, IShaderResourceBinding *pShaderResourceBinding)=0 |
Transitions shader resources to the require states. More... | |
virtual void | CommitShaderResources (IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)=0 |
Commits shader resources to the device context. More... | |
virtual void | SetStencilRef (Uint32 StencilRef)=0 |
Sets the stencil reference value. More... | |
virtual void | SetBlendFactors (const float *pBlendFactors=nullptr)=0 |
virtual void | SetVertexBuffers (Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags)=0 |
Binds vertex buffers to the pipeline. More... | |
virtual void | ClearState ()=0 |
Clears the context state. | |
virtual void | SetIndexBuffer (IBuffer *pIndexBuffer, Uint32 ByteOffset)=0 |
Binds an index buffer to the pipeline. More... | |
virtual void | SetViewports (Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight)=0 |
Sets an array of viewports. More... | |
virtual void | SetScissorRects (Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight)=0 |
Sets active scissor rects. More... | |
virtual void | SetRenderTargets (Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil)=0 |
Binds one or more render targets and the depth-stencil buffer to the pipeline. It also sets the viewport to match the first non-null render target or depth-stencil buffer. More... | |
virtual void | Draw (DrawAttribs &DrawAttribs)=0 |
Executes a draw command. More... | |
virtual void | DispatchCompute (const DispatchComputeAttribs &DispatchAttrs)=0 |
Executes a dispatch compute command. More... | |
virtual void | ClearDepthStencil (ITextureView *pView, Uint32 ClearFlags=CLEAR_DEPTH_FLAG, float fDepth=1.f, Uint8 Stencil=0)=0 |
Clears a depth-stencil view. More... | |
virtual void | ClearRenderTarget (ITextureView *pView, const float *RGBA=nullptr)=0 |
Clears a render target view. More... | |
virtual void | FinishCommandList (class ICommandList **ppCommandList)=0 |
Finishes recording commands and generates a command list. More... | |
virtual void | ExecuteCommandList (class ICommandList *pCommandList)=0 |
Executes recorded commands in a command list. More... | |
virtual void | Flush ()=0 |
Flushes the command buffer. | |
Public Member Functions inherited from Diligent::IObject | |
virtual Atomics::Long | AddRef ()=0 |
Increments the number of strong references by 1. More... | |
virtual Atomics::Long | Release ()=0 |
Decrements the number of strong references by 1 and destroys the object when the counter reaches zero. More... | |
virtual IReferenceCounters * | GetReferenceCounters () const =0 |
Returns the pointer to IReferenceCounters interface of the associated reference counters object. The metod does NOT increment the number of strong references to the returned object. | |
Device context interface.
|
pure virtual |
Clears a depth-stencil view.
[in] | pView | - Pointer to ITextureView interface to clear. The view type must be Diligent::TEXTURE_VIEW_DEPTH_STENCIL. |
[in] | ClearFlags | - Idicates which parts of the buffer to clear, see Diligent::CLEAR_DEPTH_STENCIL_FLAGS. |
[in] | fDepth | - Value to clear depth part of the view with. |
[in] | Stencil | - Value to clear stencil part of the view with. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Clears a render target view.
[in] | pView | - Pointer to ITextureView interface to clear. The view type must be Diligent::TEXTURE_VIEW_RENDER_TARGET. |
[in] | RGBA | - A 4-component array that represents the color to fill the render target with. If nullptr is provided, the default array {0,0,0,0} will be used. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Commits shader resources to the device context.
[in] | pShaderResourceBinding | - Shader resource binding whose resources will be committed. If pipeline state contains no shader resources, this parameter can be null. |
[in] | Flags | - Additional flags for the operation. See Diligent::COMMIT_SHADER_RESOURCES_FLAG for a list of allowed values. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Executes a dispatch compute command.
[in] | DispatchAttrs | - Structure describing dispatch command attributes, see DispatchComputeAttribs for details. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Executes a draw command.
[in] | DrawAttribs | - Structure describing draw command attributes, see DrawAttribs for details. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Executes recorded commands in a command list.
[in] | pCommandList | - Pointer to the command list to executre. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Finishes recording commands and generates a command list.
[out] | ppCommandList | - Memory location where pointer to the recorded command list will be written. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
[in] | pBlendFactors | - Array of four blend factors, one for each RGBA component. Theses factors are used if the blend state uses one of the Diligent::BLEND_FACTOR_BLEND_FACTOR or Diligent::BLEND_FACTOR_INV_BLEND_FACTOR blend factors. If nullptr is provided, default blend factors array {1,1,1,1} will be used. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Binds an index buffer to the pipeline.
[in] | pIndexBuffer | - Pointer to the index buffer. The buffer must have been created with the Diligent::BIND_INDEX_BUFFER flag. |
[in] | ByteOffset | - Offset from the beginning of the buffer to the start of index data. |
Implemented in Diligent::DeviceContextBase< IDeviceContextGL >, Diligent::DeviceContextBase< IDeviceContext >, Diligent::DeviceContextBase< IDeviceContextD3D11 >, Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Sets the pipeline state.
[in] | pPipelineState | - Pointer to IPipelineState interface to bind to the context. |
Implemented in Diligent::DeviceContextBase< IDeviceContextGL >, Diligent::DeviceContextBase< IDeviceContext >, Diligent::DeviceContextBase< IDeviceContextD3D11 >, Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Binds one or more render targets and the depth-stencil buffer to the pipeline. It also sets the viewport to match the first non-null render target or depth-stencil buffer.
[in] | NumRenderTargets | - Number of render targets to bind. |
[in] | ppRenderTargets | - Array of pointers to ITextureView that represent the render targets to bind to the device. The type of each view in the array must be Diligent::TEXTURE_VIEW_RENDER_TARGET. |
[in] | pDepthStencil | - Pointer to the ITextureView that represents the depth stencil to bind to the device. The view type must be Diligent::TEXTURE_VIEW_DEPTH_STENCIL. |
pContext->SetRenderTargets(0, nullptr, nullptr);
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Sets active scissor rects.
[in] | NumRects | - Number of scissor rectangles to set. |
[in] | pRects | - An array of Rect structures describing the scissor rectangles to bind. |
[in] | RTWidth | - Render target width. If 0 is provided, width of the currently bound render target will be used. |
[in] | RTHeight | - Render target height. If 0 is provided, height of the currently bound render target will be used. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Sets the stencil reference value.
[in] | StencilRef | - Stencil reference value. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Binds vertex buffers to the pipeline.
[in] | StartSlot | - The first input slot for binding. The first vertex buffer is explicitly bound to the start slot; each additional vertex buffer in the array is implicitly bound to each subsequent input slot. |
[in] | NumBuffersSet | - The number of vertex buffers in the array. |
[in] | ppBuffers | - A pointer to an array of vertex buffers. |
[in] | pStrides | - Pointer to an array of stride values; one stride value for each buffer in the vertex-buffer array. Each stride is the size (in bytes) of the elements that are to be used from that vertex buffer. If this parameter is nullptr, tight strides from the input layout will be used for each buffer. See IPipelineState::GetTightStrides(). |
[in] | pOffsets | - Pointer to an array of offset values; one offset value for each buffer in the vertex-buffer array. Each offset is the number of bytes between the first element of a vertex buffer and the first element that will be used. If this parameter is nullptr, zero offsets for all buffers will be used. |
[in] | Flags | - Additional flags for the operation. See Diligent::SET_VERTEX_BUFFERS_FLAGS for a list of allowed values. |
Implemented in Diligent::DeviceContextBase< IDeviceContextGL >, Diligent::DeviceContextBase< IDeviceContext >, Diligent::DeviceContextBase< IDeviceContextD3D11 >, Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Sets an array of viewports.
[in] | NumViewports | - Number of viewports to set. |
[in] | pViewports | - An array of Viewport structures describing the viewports to bind. |
[in] | RTWidth | - Render target width. If 0 is provided, width of the currently bound render target will be used. |
[in] | RTHeight- | Render target height. If 0 is provided, height of the currently bound render target will be used. |
pContext->SetViewports(1, nullptr, 0, 0);
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.
|
pure virtual |
Transitions shader resources to the require states.
[in] | pPipelineState | - Pipeline state object that was used to create the shader resource binding. |
[in] | pShaderResourceBinding | - Shader resource binding whose resources will be transitioned. |
Implemented in Diligent::DeviceContextD3D12Impl, Diligent::DeviceContextD3D11Impl, and Diligent::DeviceContextGLImpl.