Class CommandList
Performs resource bindings and primitive-based rendering. See the GraphicsDevice class to learn more about the class.
public class CommandList : GraphicsResourceBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
CommandList
- Implements
- Inherited Members
- Extension Methods
Properties
DepthStencilBuffer
Gets the depth stencil buffer currently sets on this instance.
public Texture DepthStencilBuffer { get; }
Property Value
- Texture
The depth stencil buffer currently sets on this instance.
RenderTarget
Gets the render target buffer currently sets on this instance.
public Texture RenderTarget { get; }
Property Value
- Texture
The render target buffer currently sets on this instance.
RenderTargetCount
public int RenderTargetCount { get; }
Property Value
RenderTargets
public Texture[] RenderTargets { get; }
Property Value
- Texture[]
Scissor
Gets the first scissor.
public Rectangle Scissor { get; }
Property Value
- Rectangle
The first scissor.
Viewport
Gets the first viewport.
public Viewport Viewport { get; }
Property Value
- Viewport
The first viewport.
ViewportCount
public int ViewportCount { get; }
Property Value
Viewports
public Viewport[] Viewports { get; }
Property Value
- Viewport[]
Methods
BeginProfile(Color4, string)
Begins debug event.
public void BeginProfile(Color4 profileColor, string name)
Parameters
Clear(Texture, Color4)
Clears the specified render target. See Textures+and+render+targets to learn how to use it.
public void Clear(Texture renderTarget, Color4 color)
Parameters
Exceptions
- ArgumentNullException
renderTarget
Clear(Texture, DepthStencilClearOptions, float, byte)
Clears the specified depth stencil buffer. See Textures+and+render+targets to learn how to use it.
public void Clear(Texture depthStencilBuffer, DepthStencilClearOptions options, float depth = 1, byte stencil = 0)
Parameters
depthStencilBuffer
TextureThe depth stencil buffer.
options
DepthStencilClearOptionsThe options.
depth
floatThe depth.
stencil
byteThe stencil.
Exceptions
ClearReadWrite(Buffer, Int4)
Clears a read-write Buffer. This buffer must have been created with read-write/unordered access.
public void ClearReadWrite(Buffer buffer, Int4 value)
Parameters
Exceptions
- ArgumentNullException
buffer
- ArgumentException
Expecting buffer supporting UAV;buffer
ClearReadWrite(Buffer, UInt4)
Clears a read-write Buffer. This buffer must have been created with read-write/unordered access.
public void ClearReadWrite(Buffer buffer, UInt4 value)
Parameters
Exceptions
- ArgumentNullException
buffer
- ArgumentException
Expecting buffer supporting UAV;buffer
ClearReadWrite(Buffer, Vector4)
Clears a read-write Buffer. This buffer must have been created with read-write/unordered access.
public void ClearReadWrite(Buffer buffer, Vector4 value)
Parameters
Exceptions
- ArgumentNullException
buffer
- ArgumentException
Expecting buffer supporting UAV;buffer
ClearReadWrite(Texture, Int4)
Clears a read-write Texture. This texture must have been created with read-write/unordered access.
public void ClearReadWrite(Texture texture, Int4 value)
Parameters
Exceptions
- ArgumentNullException
texture
- ArgumentException
Expecting texture supporting UAV;texture
ClearReadWrite(Texture, UInt4)
Clears a read-write Texture. This texture must have been created with read-write/unordered access.
public void ClearReadWrite(Texture texture, UInt4 value)
Parameters
Exceptions
- ArgumentNullException
texture
- ArgumentException
Expecting texture supporting UAV;texture
ClearReadWrite(Texture, Vector4)
Clears a read-write Texture. This texture must have been created with read-write/unordered access.
public void ClearReadWrite(Texture texture, Vector4 value)
Parameters
Exceptions
- ArgumentNullException
texture
- ArgumentException
Expecting texture supporting UAV;texture
ClearState()
Clears the state and restore the state of the device.
public void ClearState()
Close()
public CompiledCommandList Close()
Returns
Copy(GraphicsResource, GraphicsResource)
Copy a texture. View is ignored and full underlying texture is copied.
public void Copy(GraphicsResource source, GraphicsResource destination)
Parameters
source
GraphicsResourceThe source texture.
destination
GraphicsResourceThe destination texture.
CopyCount(Buffer, Buffer, int)
public void CopyCount(Buffer sourceBuffer, Buffer destBuffer, int offsetInBytes)
Parameters
CopyMultisample(Texture, int, Texture, int, PixelFormat)
public void CopyMultisample(Texture sourceMultisampleTexture, int sourceSubResource, Texture destTexture, int destSubResource, PixelFormat format = PixelFormat.None)
Parameters
sourceMultisampleTexture
TexturesourceSubResource
intdestTexture
TexturedestSubResource
intformat
PixelFormat
CopyRegion(GraphicsResource, int, ResourceRegion?, GraphicsResource, int, int, int, int)
public void CopyRegion(GraphicsResource source, int sourceSubresource, ResourceRegion? sourecRegion, GraphicsResource destination, int destinationSubResource, int dstX = 0, int dstY = 0, int dstZ = 0)
Parameters
source
GraphicsResourcesourceSubresource
intsourecRegion
ResourceRegion?destination
GraphicsResourcedestinationSubResource
intdstX
intdstY
intdstZ
int
Dispatch(Buffer, int)
Dispatches the specified indirect buffer.
public void Dispatch(Buffer indirectBuffer, int offsetInBytes)
Parameters
Dispatch(int, int, int)
public void Dispatch(int threadCountX, int threadCountY, int threadCountZ)
Parameters
Draw(int, int)
Draw non-indexed, non-instanced primitives.
public void Draw(int vertexCount, int startVertexLocation = 0)
Parameters
vertexCount
intNumber of vertices to draw.
startVertexLocation
intIndex of the first vertex, which is usually an offset in a vertex buffer; it could also be used as the first vertex id generated for a shader parameter marked with the SV_TargetId system-value semantic.
DrawAuto()
Draw geometry of an unknown size.
public void DrawAuto()
DrawIndexed(int, int, int)
Draw indexed, non-instanced primitives.
public void DrawIndexed(int indexCount, int startIndexLocation = 0, int baseVertexLocation = 0)
Parameters
indexCount
intNumber of indices to draw.
startIndexLocation
intThe location of the first index read by the GPU from the index buffer.
baseVertexLocation
intA value added to each index before reading a vertex from the vertex buffer.
DrawIndexedInstanced(Buffer, int)
Draw indexed, instanced, GPU-generated primitives.
public void DrawIndexedInstanced(Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0)
Parameters
argumentsBuffer
BufferA buffer containing the GPU generated primitives.
alignedByteOffsetForArgs
intOffset in pBufferForArgs to the start of the GPU generated primitives.
DrawIndexedInstanced(int, int, int, int, int)
Draw indexed, instanced primitives.
public void DrawIndexedInstanced(int indexCountPerInstance, int instanceCount, int startIndexLocation = 0, int baseVertexLocation = 0, int startInstanceLocation = 0)
Parameters
indexCountPerInstance
intNumber of indices read from the index buffer for each instance.
instanceCount
intNumber of instances to draw.
startIndexLocation
intThe location of the first index read by the GPU from the index buffer.
baseVertexLocation
intA value added to each index before reading a vertex from the vertex buffer.
startInstanceLocation
intA value added to each index before reading per-instance data from a vertex buffer.
DrawInstanced(Buffer, int)
Draw instanced, GPU-generated primitives.
public void DrawInstanced(Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0)
Parameters
argumentsBuffer
BufferAn arguments buffer
alignedByteOffsetForArgs
intOffset in pBufferForArgs to the start of the GPU generated primitives.
DrawInstanced(int, int, int, int)
Draw non-indexed, instanced primitives.
public void DrawInstanced(int vertexCountPerInstance, int instanceCount, int startVertexLocation = 0, int startInstanceLocation = 0)
Parameters
vertexCountPerInstance
intNumber of vertices to draw.
instanceCount
intNumber of instances to draw.
startVertexLocation
intIndex of the first vertex.
startInstanceLocation
intA value added to each index before reading per-instance data from a vertex buffer.
EndProfile()
Ends debug event.
public void EndProfile()
Flush()
public void Flush()
MapSubresource(GraphicsResource, int, MapMode, bool, int, int)
Maps a subresource.
public MappedResource MapSubresource(GraphicsResource resource, int subResourceIndex, MapMode mapMode, bool doNotWait = false, int offsetInBytes = 0, int lengthInBytes = 0)
Parameters
resource
GraphicsResourceThe resource.
subResourceIndex
intIndex of the sub resource.
mapMode
MapModeThe map mode.
doNotWait
boolif set to
true
this method will return immediately if the resource is still being used by the GPU for writing. Default is falseoffsetInBytes
intThe offset information in bytes.
lengthInBytes
intThe length information in bytes.
Returns
- MappedResource
Pointer to the sub resource to map.
New(GraphicsDevice)
public static CommandList New(GraphicsDevice device)
Parameters
device
GraphicsDevice
Returns
OnDestroyed()
Called when graphics device has been detected to be internally destroyed.
protected override void OnDestroyed()
Reset()
public void Reset()
ResetTargets()
Unbinds all depth-stencil buffer and render targets from the output-merger stage.
public void ResetTargets()
ResourceBarrierTransition(GraphicsResource, GraphicsResourceState)
public void ResourceBarrierTransition(GraphicsResource resource, GraphicsResourceState newState)
Parameters
resource
GraphicsResourcenewState
GraphicsResourceState
SetBlendFactor(Color4)
public void SetBlendFactor(Color4 blendFactor)
Parameters
blendFactor
Color4
SetDescriptorSets(int, DescriptorSet[])
public void SetDescriptorSets(int index, DescriptorSet[] descriptorSets)
Parameters
index
intdescriptorSets
DescriptorSet[]
SetIndexBuffer(Buffer, int, bool)
public void SetIndexBuffer(Buffer buffer, int offset, bool is32bits)
Parameters
SetPipelineState(PipelineState)
public void SetPipelineState(PipelineState pipelineState)
Parameters
pipelineState
PipelineState
SetRenderTarget(Texture, Texture)
Binds a depth-stencil buffer and a single render target to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTarget(Texture depthStencilView, Texture renderTargetView)
Parameters
depthStencilView
TextureA view of the depth-stencil buffer to bind.
renderTargetView
TextureA view of the render target to bind.
SetRenderTargetAndViewport(Texture, Texture)
Binds a depth-stencil buffer and a single render target to the output-merger stage. See Use a render target in the manual for more information.
public void SetRenderTargetAndViewport(Texture depthStencilView, Texture renderTargetView)
Parameters
depthStencilView
TextureA view of the depth-stencil buffer to bind.
renderTargetView
TextureA view of the render target to bind.
SetRenderTargetAndViewport(Texture, Texture, Texture)
public void SetRenderTargetAndViewport(Texture depthStencilView, Texture renderTargetView, Texture secondRenderTarget)
Parameters
SetRenderTargets(Texture, Texture[])
Binds a depth-stencil buffer and a set of render targets to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTargets(Texture depthStencilView, Texture[] renderTargetViews)
Parameters
depthStencilView
TextureA view of the depth-stencil buffer to bind.
renderTargetViews
Texture[]A set of render target views to bind.
Exceptions
- ArgumentNullException
renderTargetViews
SetRenderTargets(Texture, int, Texture[])
Binds a depth-stencil buffer and a set of render targets to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTargets(Texture depthStencilView, int renderTargetViewCount, Texture[] renderTargetViews)
Parameters
depthStencilView
TextureA view of the depth-stencil buffer to bind.
renderTargetViewCount
intThe number of render target in
renderTargetViews
.renderTargetViews
Texture[]A set of render target views to bind.
Exceptions
- ArgumentNullException
renderTargetViews
SetRenderTargets(Texture[])
Bind one or more render targets atomically and the depth-stencil buffer to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTargets(Texture[] renderTargetViews)
Parameters
renderTargetViews
Texture[]A set of render target views to bind.
SetRenderTargetsAndViewport(Texture, Texture[])
Binds a depth-stencil buffer and a set of render targets to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTargetsAndViewport(Texture depthStencilView, Texture[] renderTargetViews)
Parameters
depthStencilView
TextureA view of the depth-stencil buffer to bind.
renderTargetViews
Texture[]A set of render target views to bind.
Exceptions
- ArgumentNullException
renderTargetViews
SetRenderTargetsAndViewport(Texture, int, Texture[])
Binds a depth-stencil buffer and a set of render targets to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTargetsAndViewport(Texture depthStencilView, int renderTargetViewCount, Texture[] renderTargetViews)
Parameters
depthStencilView
TextureA view of the depth-stencil buffer to bind.
renderTargetViewCount
intThe number of render target in
renderTargetViews
.renderTargetViews
Texture[]A set of render target views to bind.
Exceptions
- ArgumentNullException
renderTargetViews
SetRenderTargetsAndViewport(Texture[])
Bind one or more render targets atomically and the depth-stencil buffer to the output-merger stage. See Textures+and+render+targets to learn how to use it.
public void SetRenderTargetsAndViewport(Texture[] renderTargetViews)
Parameters
renderTargetViews
Texture[]A set of render target views to bind.
SetScissorRectangle(Rectangle)
Binds a single scissor rectangle to the rasterizer stage. See Set the scissor in the manual for more information.
public void SetScissorRectangle(Rectangle rectangle)
Parameters
rectangle
RectangleThe scissor rectangle.
SetScissorRectangles(Rectangle[])
Binds a set of scissor rectangles to the rasterizer stage. See Set the scissor in the manual for more information.
public void SetScissorRectangles(Rectangle[] scissorRectangles)
Parameters
scissorRectangles
Rectangle[]The set of scissor rectangles to bind.
SetScissorRectangles(int, Rectangle[])
Binds a set of scissor rectangles to the rasterizer stage. See Set the scissor in the manual for more information.
public void SetScissorRectangles(int scissorCount, Rectangle[] scissorRectangles)
Parameters
scissorCount
intThe number of scissor rectangles to bind.
scissorRectangles
Rectangle[]The set of scissor rectangles to bind.
SetStencilReference(int)
public void SetStencilReference(int stencilReference)
Parameters
stencilReference
int
SetStreamTargets(params Buffer[])
Sets the stream targets.
public void SetStreamTargets(params Buffer[] buffers)
Parameters
buffers
Buffer[]The buffers.
SetVertexBuffer(int, Buffer, int, int)
public void SetVertexBuffer(int index, Buffer buffer, int offset, int stride)
Parameters
SetViewport(Viewport)
Sets a viewport.
public void SetViewport(Viewport value)
Parameters
value
Viewport
SetViewports(Viewport[])
Sets the viewports.
public void SetViewports(Viewport[] values)
Parameters
values
Viewport[]
SetViewports(int, Viewport[])
Sets the viewports.
public void SetViewports(int viewportCount, Viewport[] values)
Parameters
UnmapSubresource(MappedResource)
public void UnmapSubresource(MappedResource unmapped)
Parameters
unmapped
MappedResource
UnsetRenderTargets()
Unsets the render targets.
public void UnsetRenderTargets()
WriteTimestamp(QueryPool, int)
Submits a GPU timestamp query.
public void WriteTimestamp(QueryPool queryPool, int index)