Diligent Engine API Reference
|
Implementation of the Diligent::IDeviceContext interface. More...
Public Member Functions | |
virtual void | QueryInterface (const Diligent::INTERFACE_ID &IID, IObject **ppInterface) override final |
Queries the specific interface, see IObject::QueryInterface() for details. | |
virtual void | SetPipelineState (IPipelineState *pPipelineState) override final |
Base implementation of IDeviceContext::SetPipelineState(); caches references to the pipeline state object. | |
virtual void | TransitionShaderResources (IPipelineState *pPipelineState, IShaderResourceBinding *pShaderResourceBinding) override final |
Transitions shader resources to the require states. More... | |
virtual void | CommitShaderResources (IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags) override final |
Commits shader resources to the device context. More... | |
virtual void | SetStencilRef (Uint32 StencilRef) override final |
Sets the stencil reference value. More... | |
virtual void | SetBlendFactors (const float *pBlendFactors=nullptr) override final |
virtual void | SetVertexBuffers (Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags) override final |
Base implementation of IDeviceContext::SetVertexBuffers(); validates parameters and caches references to the buffers. | |
virtual void | InvalidateState () override final |
Invalidates the cached context state. More... | |
virtual void | SetIndexBuffer (IBuffer *pIndexBuffer, Uint32 ByteOffset) override final |
Base implementation of IDeviceContext::SetIndexBuffer(); caches the strong reference to the index buffer. | |
virtual void | SetViewports (Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight) override final |
Sets an array of viewports. More... | |
virtual void | SetScissorRects (Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight) override final |
Sets active scissor rects. More... | |
virtual void | SetRenderTargets (Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil) override final |
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) override final |
Executes a draw command. More... | |
virtual void | DispatchCompute (const DispatchComputeAttribs &DispatchAttrs) override final |
Executes a dispatch compute command. More... | |
virtual void | ClearDepthStencil (ITextureView *pView, Uint32 ClearFlags, float fDepth, Uint8 Stencil) override final |
Clears a depth-stencil view. More... | |
virtual void | ClearRenderTarget (ITextureView *pView, const float *RGBA) override final |
Clears a render target view. More... | |
virtual void | Flush () override final |
Flushes the command buffer. | |
virtual void | FinishCommandList (class ICommandList **ppCommandList) override final |
Finishes recording commands and generates a command list. More... | |
virtual void | ExecuteCommandList (class ICommandList *pCommandList) override final |
Executes recorded commands in a command list. More... | |
virtual void | TransitionTextureState (ITexture *pTexture, D3D12_RESOURCE_STATES State) override final |
Transitions internal D3D12 texture object to a specified state. More... | |
virtual void | TransitionBufferState (IBuffer *pBuffer, D3D12_RESOURCE_STATES State) override final |
Transitions internal D3D12 buffer object to a specified state. More... | |
![]() | |
DeviceContextBase (IReferenceCounters *pRefCounters, IRenderDevice *pRenderDevice, bool bIsDeferred) | |
bool | CommitShaderResources (IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags, int) |
Base implementation of IDeviceContext::CommitShaderResources(); validates parameters. | |
void | SetViewports (Uint32 NumViewports, const Viewport *pViewports, Uint32 &RTWidth, Uint32 &RTHeight) |
Caches the viewports. | |
void | SetScissorRects (Uint32 NumRects, const Rect *pRects, Uint32 &RTWidth, Uint32 &RTHeight) |
Caches the scissor rects. | |
bool | SetRenderTargets (Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil, Uint32 Dummy=0) |
Caches the render target and depth stencil views. Returns true if any view is different from the cached value and false otherwise. | |
virtual void | SetSwapChain (ISwapChain *pSwapChain) override final |
Sets the strong pointer to the swap chain. | |
ISwapChain * | GetSwapChain () |
Returns the swap chain. | |
bool | IsDefaultFBBound () |
Returns true if currently bound frame buffer is the default frame buffer. | |
void | GetPipelineState (IPipelineState **ppPSO, float *BlendFactors, Uint32 &StencilRef) |
Returns currently bound pipeline state and blend factors. | |
void | GetRenderTargets (Uint32 &NumRenderTargets, ITextureView **ppRTVs, ITextureView **ppDSV) |
Returns currently bound render targets. | |
void | GetViewports (Uint32 &NumViewports, Viewport *pViewports) |
Returns currently set viewports. | |
IRenderDevice * | GetDevice () |
Returns the render device. | |
Additional Inherited Members | |
![]() | |
void | GetRenderTargetSize (Uint32 &RTWidth, Uint32 &RTHeight) |
Returns the size of the currently bound render target. | |
void | ClearStateCache () |
Clears all cached resources. | |
![]() | |
RefCntAutoPtr< IRenderDevice > | m_pDevice |
Strong reference to the device. | |
RefCntAutoPtr< ISwapChain > | m_pSwapChain |
Strong reference to the swap chain. Swap chain holds weak reference to the immediate context. | |
VertexStreamInfo | m_VertexStreams [MaxBufferSlots] |
Vertex streams. Every stream holds strong reference to the buffer. | |
Uint32 | m_NumVertexStreams |
Number of bound vertex streams. | |
RefCntAutoPtr< IPipelineState > | m_pPipelineState |
Strong reference to the bound pipeline state object. | |
RefCntAutoPtr< IBuffer > | m_pIndexBuffer |
Strong reference to the bound index buffer. | |
Uint32 | m_IndexDataStartOffset |
Offset from the beginning of the index buffer to the start of the index data, in bytes. | |
Uint32 | m_StencilRef |
Current stencil reference value. | |
Float32 | m_BlendFactors [4] |
Curent blend factors. | |
Viewport | m_Viewports [MaxRenderTargets] |
Current viewports. | |
Uint32 | m_NumViewports |
Number of current viewports. | |
Rect | m_ScissorRects [MaxRenderTargets] |
Current scissor rects. | |
Uint32 | m_NumScissorRects |
Number of current scissor rects. | |
RefCntAutoPtr< ITextureView > | m_pBoundRenderTargets [MaxRenderTargets] |
Vector of strong references to the bound render targets. | |
Uint32 | m_NumBoundRenderTargets |
Number of bound render targets. | |
bool | m_IsDefaultFramebufferBound |
Flag indicating if default render target & depth-stencil buffer are currently bound. | |
RefCntAutoPtr< ITextureView > | m_pBoundDepthStencil |
Strong references to the bound depth stencil view. | |
Implementation of the Diligent::IDeviceContext interface.
|
finaloverridevirtual |
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. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
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. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
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. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Executes a dispatch compute command.
[in] | DispatchAttrs | - Structure describing dispatch command attributes, see DispatchComputeAttribs for details. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Executes a draw command.
[in] | DrawAttribs | - Structure describing draw command attributes, see DrawAttribs for details. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Executes recorded commands in a command list.
[in] | pCommandList | - Pointer to the command list to executre. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Finishes recording commands and generates a command list.
[out] | ppCommandList | - Memory location where pointer to the recorded command list will be written. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Invalidates the cached context state.
This method should be called by say Unity plugin before (or after) issuing draw commands to invalidate cached states
Implements Diligent::DeviceContextBase< IDeviceContextD3D12 >.
|
finaloverridevirtual |
[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. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
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);
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
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. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Sets the stencil reference value.
[in] | StencilRef | - Stencil reference value. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
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);
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Transitions internal D3D12 buffer object to a specified state.
[in] | pBuffer | - Buffer to transition |
[in] | State | - D3D12 resource state this buffer to transition to |
Implements Diligent::IDeviceContextD3D12.
|
finaloverridevirtual |
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. |
Implements Diligent::IDeviceContext.
|
finaloverridevirtual |
Transitions internal D3D12 texture object to a specified state.
[in] | pTexture | - texture to transition |
[in] | State | - D3D12 resource state this texture to transition to |
Implements Diligent::IDeviceContextD3D12.