30 #include "DeviceCaps.h" 31 #include "Constants.h" 33 #include "InputLayout.h" 37 #include "ResourceMapping.h" 38 #include "TextureView.h" 39 #include "BufferView.h" 40 #include "DepthStencilState.h" 41 #include "BlendState.h" 42 #include "PipelineState.h" 43 #include "CommandList.h" 44 #include "SwapChain.h" 50 static constexpr INTERFACE_ID IID_DeviceContext =
51 { 0xdc92711b, 0xa1be, 0x4319, { 0xb2, 0xbd, 0xc6, 0x62, 0xd1, 0xcc, 0x19, 0xe4 } };
400 Viewport(Float32 _TopLeftX = 0, Float32 _TopLeftY = 0,
401 Float32 _Width = 0, Float32 _Height = 0,
402 Float32 _MinDepth = 0, Float32 _MaxDepth = 1 )
428 Rect( Int32 _left = 0, Int32 _top = 0, Int32 _right = 0, Int32 _bottom = 0 ) :
447 virtual void QueryInterface(
const Diligent::INTERFACE_ID &IID, IObject **ppInterface ) = 0;
493 virtual void SetBlendFactors(
const float* pBlendFactors =
nullptr) = 0;
521 Uint32 NumBuffersSet,
563 virtual void SetViewports( Uint32 NumViewports,
const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight ) = 0;
578 virtual void SetScissorRects( Uint32 NumRects,
const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight ) = 0;
645 virtual void Flush() = 0;
Interpret the vertex data as a list of points. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_POINTLIST. OpenGL counterpart: GL_POINTS.
Definition: DeviceContext.h:71
virtual void SetIndexBuffer(IBuffer *pIndexBuffer, Uint32 ByteOffset)=0
Binds an index buffer to the pipeline.
virtual void SetScissorRects(Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight)=0
Sets active scissor rects.
virtual void SetStencilRef(Uint32 StencilRef)=0
Sets the stencil reference value.
Interpret the vertex data as a list of 20 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:155
virtual void Draw(DrawAttribs &DrawAttribs)=0
Executes a draw command.
Uint32 FirstInstanceLocation
For instanced rendering, LOCATION (or INDEX, but NOT the byte offset) in the vertex buffer to start r...
Definition: DeviceContext.h:260
Rect(Int32 _left=0, Int32 _top=0, Int32 _right=0, Int32 _bottom=0)
Initializes the structure.
Definition: DeviceContext.h:428
PRIMITIVE_TOPOLOGY
Input primitive topology.
Definition: DeviceContext.h:56
Interpret the vertex data as a list of 11 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:119
Uint32 BaseVertex
For indexed rendering, a constant which is added to each index before accessing the vertex buffer...
Definition: DeviceContext.h:242
Undefined type.
Definition: GraphicsTypes.h:41
CLEAR_DEPTH_STENCIL_FLAGS
Defines which parts of the depth-stencil buffer to clear.
Definition: DeviceContext.h:301
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Float32 TopLeftX
X coordinate of the left boundary of the viewport.
Definition: DeviceContext.h:379
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 viewp...
Interpret the vertex data as a list of 16 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:139
virtual void DispatchCompute(const DispatchComputeAttribs &DispatchAttrs)=0
Executes a dispatch compute command.
virtual void SetPipelineState(IPipelineState *pPipelineState)=0
Sets the pipeline state.
Interpret the vertex data as a list of five control point patches. D3D counterpart: D3D_PRIMITIVE_TO...
Definition: DeviceContext.h:95
virtual void QueryInterface(const Diligent::INTERFACE_ID &IID, IObject **ppInterface)=0
Queries the specific interface, see IObject::QueryInterface() for details.
Interpret the vertex data as a list of 15 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:135
Interpret the vertex data as a list of nine control point patches. D3D counterpart: D3D_PRIMITIVE_TO...
Definition: DeviceContext.h:111
Interpret the vertex data as a list of 32 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:203
IBuffer * pIndirectDrawAttribs
For indirect rendering, pointer to the buffer, from which draw attributes will be read...
Definition: DeviceContext.h:264
virtual void Flush()=0
Flushes the command buffer.
Describes the viewport.
Definition: DeviceContext.h:376
Int32 bottom
Y coordinate of the bottom boundary of the viewport.
Definition: DeviceContext.h:425
SET_VERTEX_BUFFERS_FLAGS
Defines allowed flags for IDeviceContext::SetVertexBuffers() function.
Definition: DeviceContext.h:355
Float32 MinDepth
Minimum depth of the viewport. Ranges between 0 and 1.
Definition: DeviceContext.h:394
DrawAttribs()
Initializes the structure members with default values.
Definition: DeviceContext.h:283
Viewport(Float32 _TopLeftX=0, Float32 _TopLeftY=0, Float32 _Width=0, Float32 _Height=0, Float32 _MinDepth=0, Float32 _MaxDepth=1)
Initializes the structure.
Definition: DeviceContext.h:400
Interpret the vertex data as a list of four control point patches. D3D counterpart: D3D_PRIMITIVE_TO...
Definition: DeviceContext.h:91
Interpret the vertex data as a list of 30 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:195
Shader resource binding interface.
Definition: ShaderResourceBinding.h:40
Interpret the vertex data as a list of 22 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:163
Float32 Width
Viewport width.
Definition: DeviceContext.h:388
Undefined topology.
Definition: DeviceContext.h:59
Bool IsIndirect
Indicates if indirect draw call will be performed. If set to True, pIndirectDrawAttribs must contain ...
Definition: DeviceContext.h:238
Int32 right
X coordinate of the right boundary of the viewport.
Definition: DeviceContext.h:424
Interpret the vertex data as a list of 24 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:171
Describes dispatch command arguments.
Definition: DeviceContext.h:312
DispatchComputeAttribs(Uint32 GroupsX=1, Uint32 GroupsY=1, Uint32 GroupsZ=1)
Initializes the structure to perform non-indirect dispatch command.
Definition: DeviceContext.h:332
Interpret the vertex data as a list of lines. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_LINELIST. OpenGL counterpart: GL_LINES.
Definition: DeviceContext.h:75
Interpret the vertex data as a list of 19 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:151
virtual void TransitionShaderResources(IPipelineState *pPipelineState, IShaderResourceBinding *pShaderResourceBinding)=0
Transitions shader resources to the require states.
Interpret the vertex data as a list of eight control point patches. D3D counterpart: D3D_PRIMITIVE_T...
Definition: DeviceContext.h:107
Interpret the vertex data as a list of ten control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: DeviceContext.h:115
DispatchComputeAttribs(IBuffer *pDispatchAttribs, Uint32 Offset=0)
Initializes the structure to perform indirect dispatch command.
Definition: DeviceContext.h:345
Interpret the vertex data as a list of 28 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:187
Buffer interface.
Definition: Buffer.h:200
virtual void FinishCommandList(ICommandList **ppCommandList)=0
Finishes recording commands and generates a command list.
VALUE_TYPE IndexType
For an indexed draw call, type of elements in the index buffer. Allowed values: VT_UINT16 and VT_UINT...
Definition: DeviceContext.h:226
virtual void SetBlendFactors(const float *pBlendFactors=nullptr)=0
Uint32 DispatchArgsByteOffset
If pIndirectDispatchAttribs is not nullptr, indicates offset from the beginning of the buffer to the ...
Definition: DeviceContext.h:325
Device context interface.
Definition: DeviceContext.h:443
Int32 left
X coordinate of the left boundary of the viewport.
Definition: DeviceContext.h:422
Swap chain interface.
Definition: SwapChain.h:41
Int32 top
Y coordinate of the top boundary of the viewport.
Definition: DeviceContext.h:423
Interpret the vertex data as a list of 21 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:159
Uint32 NumIndices
For an indexed draw call, number of indices to draw.
Definition: DeviceContext.h:222
virtual void InvalidateState()=0
Invalidates the cached context state.
Interpret the vertex data as a list of six control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: DeviceContext.h:99
Texture view interface.
Definition: TextureView.h:163
Uint32 NumVertices
For a non-indexed draw call, number of vertices to draw.
Definition: DeviceContext.h:219
Interpret the vertex data as a list of 17 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:143
VALUE_TYPE
Value type.
Definition: GraphicsTypes.h:39
Command list interface.
Definition: CommandList.h:42
Interpret the vertex data as a list of 25 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:175
Interpret the vertex data as a list of 12 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:123
Interpret the vertex data as a list of 13 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:127
Definition: PipelineState.h:209
virtual void ExecuteCommandList(ICommandList *pCommandList)=0
Executes recorded commands in a command list.
Uint32 NumInstances
Number of instances to draw. If more than one instance is specified, instanced draw call will be perf...
Definition: DeviceContext.h:233
Interpret the vertex data as a list of 26 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:179
Uint32 ThreadGroupCountY
Number of groups dispatched in Y direction.
Definition: DeviceContext.h:315
Interpret the vertex data as a list of 23 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:167
Defines the draw command attributes.
Definition: DeviceContext.h:212
virtual void CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)=0
Commits shader resources to the device context.
Transition resources being committed.
Definition: DeviceContext.h:369
Clear stencil part of the buffer.
Definition: DeviceContext.h:304
virtual void SetViewports(Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight)=0
Sets an array of viewports.
virtual void SetVertexBuffers(Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags)=0
Binds vertex buffers to the pipeline.
Describes the rectangle.
Definition: DeviceContext.h:420
Float32 Height
Viewport Height.
Definition: DeviceContext.h:391
virtual void ClearDepthStencil(ITextureView *pView, Uint32 ClearFlags=CLEAR_DEPTH_FLAG, float fDepth=1.f, Uint8 Stencil=0)=0
Clears a depth-stencil view.
Interpret the vertex data as a list of 31 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:199
Clear depth part of the buffer.
Definition: DeviceContext.h:303
Interpret the vertex data as a list of three control point patches. D3D counterpart: D3D_PRIMITIVE_T...
Definition: DeviceContext.h:87
Interpret the vertex data as a triangle strip. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP...
Definition: DeviceContext.h:67
virtual void SetSwapChain(ISwapChain *pSwapChain)=0
Sets the swap chain in the device context.
Uint32 ThreadGroupCountX
Number of groups dispatched in X direction.
Definition: DeviceContext.h:314
Helper value that stores the total number of topologies in the enumeration.
Definition: DeviceContext.h:206
Float32 TopLeftY
Y coordinate of the top boundary of the viewport. When defining a viewport, DirectX convention is use...
Definition: DeviceContext.h:385
Reset the vertex buffers to only the buffers specified in this call. All buffers previously bound to ...
Definition: DeviceContext.h:359
Interpret the vertex data as a list of one control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: DeviceContext.h:79
COMMIT_SHADER_RESOURCES_FLAG
Defines allowed flags for IDeviceContext::CommitShaderResources() function.
Definition: DeviceContext.h:363
Interpret the vertex data as a list of triangles. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_TRIANGLELI...
Definition: DeviceContext.h:63
Interpret the vertex data as a list of 29 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:191
Interpret the vertex data as a list of two control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: DeviceContext.h:83
Interpret the vertex data as a list of 14 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:131
Interpret the vertex data as a list of seven control point patches. D3D counterpart: D3D_PRIMITIVE_T...
Definition: DeviceContext.h:103
Uint32 IndirectDrawArgsOffset
For indirect rendering, offset from the beginning of the buffer to the location of draw command attri...
Definition: DeviceContext.h:246
IBuffer * pIndirectDispatchAttribs
Pointer to the buffer containing dispatch arguments. If not nullptr, then indirect dispatch command i...
Definition: DeviceContext.h:321
Interpret the vertex data as a list of 18 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:147
Bool IsIndexed
Indicates if index buffer will be used to index input vertices.
Definition: DeviceContext.h:229
Uint32 StartVertexLocation
For non-indexed rendering, LOCATION (or INDEX, but NOT the byte offset) of the first vertex in the ve...
Definition: DeviceContext.h:252
Uint32 ThreadGroupCountZ
Number of groups dispatched in Z direction.
Definition: DeviceContext.h:316
Interpret the vertex data as a list of 27 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: DeviceContext.h:183
virtual void ClearRenderTarget(ITextureView *pView, const float *RGBA=nullptr)=0
Clears a render target view.
Float32 MaxDepth
Maximum depth of the viewport. Ranges between 0 and 1.
Definition: DeviceContext.h:397
PRIMITIVE_TOPOLOGY Topology
Input primitive topology, see Diligent::PRIMITIVE_TOPOLOGY.
Definition: DeviceContext.h:215
Uint32 FirstIndexLocation
For indexed rendering, LOCATION (NOT the byte offset) of the first index in the index buffer to start...
Definition: DeviceContext.h:256