Class CommandList
A device resource which allows the recording of graphics commands, which can later be executed by a GraphicsDevice. Before graphics commands can be issued, the Begin() method must be invoked. When the CommandList is ready to be executed, End() must be invoked, and then SubmitCommands(CommandList) should be used. NOTE: The use of CommandList is not thread-safe. Access to the CommandList must be externally synchronized. There are some limitations dictating proper usage and ordering of graphics commands. For example, a Framebuffer, Pipeline, vertex buffer, and index buffer must all be bound before a call to DrawIndexed(UInt32, UInt32, UInt32, Int32, UInt32) will succeed. These limitations are described in each function, where applicable. CommandList instances cannot be executed multiple times per-recording. When executed by a GraphicsDevice, they must be reset and commands must be issued again. See CommandListDescription.
Inheritance
Inherited Members
Namespace: Veldrid
Assembly: cs.temp.dll.dll
Syntax
public abstract class CommandList : DeviceResource, IDisposable
Properties
IsDisposed
A bool indicating whether this instance has been disposed.
Declaration
public abstract bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
A string identifying this instance. Can be used to differentiate between objects in graphics debuggers and other tools.
Declaration
public abstract string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Begin()
Puts this CommandList into the initial state. This function must be called before other graphics commands can be issued. Begin must only be called if it has not been previously called, if End() has been called, or if SubmitCommands(CommandList) has been called on this instance.
Declaration
public abstract void Begin()
ClearColorTarget(UInt32, RgbaFloat)
Clears the color target at the given index of the active Framebuffer. The index given must be less than the number of color attachments in the active Framebuffer.
Declaration
public void ClearColorTarget(uint index, RgbaFloat clearColor)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The color target index. |
RgbaFloat | clearColor | The value to clear the target to. |
ClearDepthStencil(Single)
Clears the depth-stencil target of the active Framebuffer. The active Framebuffer must have a depth attachment. With this overload, the stencil buffer is cleared to 0.
Declaration
public void ClearDepthStencil(float depth)
Parameters
Type | Name | Description |
---|---|---|
System.Single | depth | The value to clear the depth buffer to. |
ClearDepthStencil(Single, Byte)
Clears the depth-stencil target of the active Framebuffer. The active Framebuffer must have a depth attachment.
Declaration
public void ClearDepthStencil(float depth, byte stencil)
Parameters
Type | Name | Description |
---|---|---|
System.Single | depth | The value to clear the depth buffer to. |
System.Byte | stencil | The value to clear the stencil buffer to. |
CopyBuffer(DeviceBuffer, UInt32, DeviceBuffer, UInt32, UInt32)
Copies a region from the source DeviceBuffer to another region in the destination DeviceBuffer.
Declaration
public void CopyBuffer(DeviceBuffer source, uint sourceOffset, DeviceBuffer destination, uint destinationOffset, uint sizeInBytes)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | source | The source DeviceBuffer from which data will be copied. |
System.UInt32 | sourceOffset | An offset into |
DeviceBuffer | destination | The destination DeviceBuffer into which data will be copied. |
System.UInt32 | destinationOffset | An offset into |
System.UInt32 | sizeInBytes | The number of bytes to copy. |
CopyBufferCore(DeviceBuffer, UInt32, DeviceBuffer, UInt32, UInt32)
Declaration
protected abstract void CopyBufferCore(DeviceBuffer source, uint sourceOffset, DeviceBuffer destination, uint destinationOffset, uint sizeInBytes)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | source | |
System.UInt32 | sourceOffset | |
DeviceBuffer | destination | |
System.UInt32 | destinationOffset | |
System.UInt32 | sizeInBytes |
CopyTexture(Texture, UInt32, UInt32, UInt32, UInt32, UInt32, Texture, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32)
Copies a region from one Texture into another.
Declaration
public void CopyTexture(Texture source, uint srcX, uint srcY, uint srcZ, uint srcMipLevel, uint srcBaseArrayLayer, Texture destination, uint dstX, uint dstY, uint dstZ, uint dstMipLevel, uint dstBaseArrayLayer, uint width, uint height, uint depth, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture from which data is copied. |
System.UInt32 | srcX | The X coordinate of the source copy region. |
System.UInt32 | srcY | The Y coordinate of the source copy region. |
System.UInt32 | srcZ | The Z coordinate of the source copy region. |
System.UInt32 | srcMipLevel | The mip level to copy from the source Texture. |
System.UInt32 | srcBaseArrayLayer | The starting array layer to copy from the source Texture. |
Texture | destination | The destination Texture into which data is copied. |
System.UInt32 | dstX | The X coordinate of the destination copy region. |
System.UInt32 | dstY | The Y coordinate of the destination copy region. |
System.UInt32 | dstZ | The Z coordinate of the destination copy region. |
System.UInt32 | dstMipLevel | The mip level to copy the data into. |
System.UInt32 | dstBaseArrayLayer | The starting array layer to copy data into. |
System.UInt32 | width | The width in texels of the copy region. |
System.UInt32 | height | The height in texels of the copy region. |
System.UInt32 | depth | The depth in texels of the copy region. |
System.UInt32 | layerCount | The number of array layers to copy. |
CopyTexture(Texture, Texture)
Copies all subresources from one Texture to another.
Declaration
public void CopyTexture(Texture source, Texture destination)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source of Texture data. |
Texture | destination | The destination of Texture data. |
CopyTexture(Texture, Texture, UInt32, UInt32)
Copies one subresource from one Texture to another.
Declaration
public void CopyTexture(Texture source, Texture destination, uint mipLevel, uint arrayLayer)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source of Texture data. |
Texture | destination | The destination of Texture data. |
System.UInt32 | mipLevel | The mip level to copy. |
System.UInt32 | arrayLayer | The array layer to copy. |
CopyTextureCore(Texture, UInt32, UInt32, UInt32, UInt32, UInt32, Texture, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32)
Declaration
protected abstract void CopyTextureCore(Texture source, uint srcX, uint srcY, uint srcZ, uint srcMipLevel, uint srcBaseArrayLayer, Texture destination, uint dstX, uint dstY, uint dstZ, uint dstMipLevel, uint dstBaseArrayLayer, uint width, uint height, uint depth, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | |
System.UInt32 | srcX | |
System.UInt32 | srcY | |
System.UInt32 | srcZ | |
System.UInt32 | srcMipLevel | |
System.UInt32 | srcBaseArrayLayer | |
Texture | destination | |
System.UInt32 | dstX | |
System.UInt32 | dstY | |
System.UInt32 | dstZ | |
System.UInt32 | dstMipLevel | |
System.UInt32 | dstBaseArrayLayer | |
System.UInt32 | width | |
System.UInt32 | height | |
System.UInt32 | depth | |
System.UInt32 | layerCount |
Dispatch(UInt32, UInt32, UInt32)
Dispatches a compute operation from the currently-bound compute state of this Pipeline.
Declaration
public abstract void Dispatch(uint groupCountX, uint groupCountY, uint groupCountZ)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | groupCountX | The X dimension of the compute thread groups that are dispatched. |
System.UInt32 | groupCountY | The Y dimension of the compute thread groups that are dispatched. |
System.UInt32 | groupCountZ | The Z dimension of the compute thread groups that are dispatched. |
DispatchIndirect(DeviceBuffer, UInt32)
Issues an indirect compute dispatch command based on the information contained in the given indirect DeviceBuffer. The information stored in the indirect Buffer should conform to the structure of IndirectDispatchArguments.
Declaration
public void DispatchIndirect(DeviceBuffer indirectBuffer, uint offset)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | indirectBuffer | The indirect Buffer to read from. Must have been created with the IndirectBuffer flag. |
System.UInt32 | offset | An offset, in bytes, from the start of the indirect buffer from which the draw commands will be read. This value must be a multiple of 4. |
DispatchIndirectCore(DeviceBuffer, UInt32)
Declaration
protected abstract void DispatchIndirectCore(DeviceBuffer indirectBuffer, uint offset)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | indirectBuffer | |
System.UInt32 | offset |
Dispose()
Frees unmanaged device resources controlled by this instance.
Declaration
public abstract void Dispose()
Draw(UInt32)
Draws primitives from the currently-bound state in this CommandList. An index Buffer is not used.
Declaration
public void Draw(uint vertexCount)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | vertexCount | The number of vertices. |
Draw(UInt32, UInt32, UInt32, UInt32)
Draws primitives from the currently-bound state in this CommandList. An index Buffer is not used.
Declaration
public void Draw(uint vertexCount, uint instanceCount, uint vertexStart, uint instanceStart)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | vertexCount | The number of vertices. |
System.UInt32 | instanceCount | The number of instances. |
System.UInt32 | vertexStart | The first vertex to use when drawing. |
System.UInt32 | instanceStart | The starting instance value. |
DrawIndexed(UInt32)
Draws indexed primitives from the currently-bound state in this CommandList.
Declaration
public void DrawIndexed(uint indexCount)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | indexCount | The number of indices. |
DrawIndexed(UInt32, UInt32, UInt32, Int32, UInt32)
Draws indexed primitives from the currently-bound state in this CommandList.
Declaration
public void DrawIndexed(uint indexCount, uint instanceCount, uint indexStart, int vertexOffset, uint instanceStart)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | indexCount | The number of indices. |
System.UInt32 | instanceCount | The number of instances. |
System.UInt32 | indexStart | The number of indices to skip in the active index buffer. |
System.Int32 | vertexOffset | The base vertex value, which is added to each index value read from the index buffer. |
System.UInt32 | instanceStart | The starting instance value. |
DrawIndexedIndirect(DeviceBuffer, UInt32, UInt32, UInt32)
Issues indirect, indexed draw commands based on the information contained in the given indirect DeviceBuffer. The information stored in the indirect Buffer should conform to the structure of IndirectDrawIndexedArguments.
Declaration
public void DrawIndexedIndirect(DeviceBuffer indirectBuffer, uint offset, uint drawCount, uint stride)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | indirectBuffer | The indirect Buffer to read from. Must have been created with the IndirectBuffer flag. |
System.UInt32 | offset | An offset, in bytes, from the start of the indirect buffer from which the draw commands will be read. This value must be a multiple of 4. |
System.UInt32 | drawCount | The number of draw commands to read and issue from the indirect Buffer. |
System.UInt32 | stride | The stride, in bytes, between consecutive draw commands in the indirect Buffer. This value must be a multiple of four, and must be larger than the size of IndirectDrawIndexedArguments. |
DrawIndexedIndirectCore(DeviceBuffer, UInt32, UInt32, UInt32)
Declaration
protected abstract void DrawIndexedIndirectCore(DeviceBuffer indirectBuffer, uint offset, uint drawCount, uint stride)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | indirectBuffer | |
System.UInt32 | offset | |
System.UInt32 | drawCount | |
System.UInt32 | stride |
DrawIndirect(DeviceBuffer, UInt32, UInt32, UInt32)
Issues indirect draw commands based on the information contained in the given indirect DeviceBuffer. The information stored in the indirect Buffer should conform to the structure of IndirectDrawArguments.
Declaration
public void DrawIndirect(DeviceBuffer indirectBuffer, uint offset, uint drawCount, uint stride)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | indirectBuffer | The indirect Buffer to read from. Must have been created with the IndirectBuffer flag. |
System.UInt32 | offset | An offset, in bytes, from the start of the indirect buffer from which the draw commands will be read. This value must be a multiple of 4. |
System.UInt32 | drawCount | The number of draw commands to read and issue from the indirect Buffer. |
System.UInt32 | stride | The stride, in bytes, between consecutive draw commands in the indirect Buffer. This value must be a multiple of four, and must be larger than the size of IndirectDrawArguments. |
DrawIndirectCore(DeviceBuffer, UInt32, UInt32, UInt32)
Declaration
protected abstract void DrawIndirectCore(DeviceBuffer indirectBuffer, uint offset, uint drawCount, uint stride)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | indirectBuffer | |
System.UInt32 | offset | |
System.UInt32 | drawCount | |
System.UInt32 | stride |
End()
Completes this list of graphics commands, putting it into an executable state for a GraphicsDevice. This function must only be called after Begin() has been called. It is an error to call this function in succession, unless Begin() has been called in between invocations.
Declaration
public abstract void End()
GenerateMipmaps(Texture)
Generates mipmaps for the given Texture. The largest mipmap is used to generate all of the lower mipmap levels contained in the Texture. The previous contents of all lower mipmap levels are overwritten by this operation. The target Texture must have been created with TextureUsage.GenerateMipmaps.
Declaration
public void GenerateMipmaps(Texture texture)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | The Texture to generate mipmaps for. This Texture must have been created with TextureUsage.GenerateMipmaps. |
InsertDebugMarker(String)
Inserts a debug marker into the CommandList at the current position. This is used by graphics debuggers to identify points of interest in a command stream.
Declaration
public void InsertDebugMarker(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the marker. This is an opaque identifier used for display by graphics debuggers. |
PopDebugGroup()
Pops the current debug group. This method must only be called after PushDebugGroup(String) has been called on this instance.
Declaration
public void PopDebugGroup()
PushDebugGroup(String)
Pushes a debug group at the current position in the CommandList. This allows subsequent commands to be categorized and filtered when viewed in external debugging tools. This method can be called multiple times in order to create nested debug groupings. Each call to PushDebugGroup must be followed by a matching call to PopDebugGroup().
Declaration
public void PushDebugGroup(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the group. This is an opaque identifier used for display by graphics debuggers. |
ResolveTexture(Texture, Texture)
Declaration
public void ResolveTexture(Texture source, Texture destination)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source of the resolve operation. Must be a multisampled Texture (SampleCount > 1). |
Texture | destination | The destination of the resolve operation. Must be a non-multisampled Texture (SampleCount == 1). |
ResolveTextureCore(Texture, Texture)
Declaration
protected abstract void ResolveTextureCore(Texture source, Texture destination)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source of the resolve operation. Must be a multisampled Texture (SampleCount > 1). |
Texture | destination | The destination of the resolve operation. Must be a non-multisampled Texture (SampleCount == 1). |
SetComputeResourceSet(UInt32, ResourceSet)
Sets the active ResourceSet for the given index. This ResourceSet is only active for the compute Pipeline.
Declaration
public void SetComputeResourceSet(uint slot, ResourceSet rs)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | The resource slot. |
ResourceSet | rs | The new ResourceSet. |
SetComputeResourceSet(UInt32, ResourceSet, UInt32, ref UInt32)
Sets the active ResourceSet for the given index. This ResourceSet is only active for the compute Pipeline.
Declaration
public void SetComputeResourceSet(uint slot, ResourceSet rs, uint dynamicOffsetsCount, ref uint dynamicOffsets)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | The resource slot. |
ResourceSet | rs | The new ResourceSet. |
System.UInt32 | dynamicOffsetsCount | The number of dynamic offsets being used. This must be equal to the number of dynamic buffers (DynamicBinding) contained in the ResourceSet. |
System.UInt32 | dynamicOffsets | A reference to the first of a series of offsets which will be applied to the dynamic buffers contained in the ResourceSet. These offsets are applied in the order that dynamic buffer elements appear in the ResourceSet. Each of these offsets must be a multiple of either UniformBufferMinOffsetAlignment or StructuredBufferMinOffsetAlignment, depending on the kind of resource. |
SetComputeResourceSet(UInt32, ResourceSet, UInt32[])
Sets the active ResourceSet for the given index. This ResourceSet is only active for the compute Pipeline.
Declaration
public void SetComputeResourceSet(uint slot, ResourceSet rs, uint[] dynamicOffsets)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | The resource slot. |
ResourceSet | rs | The new ResourceSet. |
System.UInt32[] | dynamicOffsets | An array containing the offsets to apply to the dynamic buffers contained in the ResourceSet. The number of elements in this array must be equal to the number of dynamic buffers (DynamicBinding) contained in the ResourceSet. These offsets are applied in the order that dynamic buffer elements appear in the ResourceSet. |
SetComputeResourceSetCore(UInt32, ResourceSet, UInt32, ref UInt32)
Declaration
protected abstract void SetComputeResourceSetCore(uint slot, ResourceSet set, uint dynamicOffsetsCount, ref uint dynamicOffsets)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | |
ResourceSet | set | |
System.UInt32 | dynamicOffsetsCount | |
System.UInt32 | dynamicOffsets |
SetFramebuffer(Framebuffer)
Sets the active Framebuffer which will be rendered to. When drawing, the active Framebuffer must be compatible with the active Pipeline. A compatible Pipeline has the same number of output attachments with matching formats.
Declaration
public void SetFramebuffer(Framebuffer fb)
Parameters
Type | Name | Description |
---|---|---|
Framebuffer | fb | The new Framebuffer. |
SetFramebufferCore(Framebuffer)
Performs API-specific handling of the Framebuffer resource.
Declaration
protected abstract void SetFramebufferCore(Framebuffer fb)
Parameters
Type | Name | Description |
---|---|---|
Framebuffer | fb |
SetFullScissorRect(UInt32)
Sets the active scissor rectangle at the given index to cover the active Framebuffer.
Declaration
public void SetFullScissorRect(uint index)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The color target index. |
SetFullScissorRects()
Sets all active scissor rectangles to cover the active Framebuffer.
Declaration
public void SetFullScissorRects()
SetFullViewport(UInt32)
Sets the active viewport at the given index to cover the entire active Framebuffer.
Declaration
public void SetFullViewport(uint index)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The color target index. |
SetFullViewports()
Sets all active viewports to cover the entire active Framebuffer.
Declaration
public void SetFullViewports()
SetGraphicsResourceSet(UInt32, ResourceSet)
Sets the active ResourceSet for the given index. This ResourceSet is only active for the graphics Pipeline.
Declaration
public void SetGraphicsResourceSet(uint slot, ResourceSet rs)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | The resource slot. |
ResourceSet | rs | The new ResourceSet. |
SetGraphicsResourceSet(UInt32, ResourceSet, UInt32, ref UInt32)
Sets the active ResourceSet for the given index. This ResourceSet is only active for the graphics Pipeline.
Declaration
public void SetGraphicsResourceSet(uint slot, ResourceSet rs, uint dynamicOffsetsCount, ref uint dynamicOffsets)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | The resource slot. |
ResourceSet | rs | The new ResourceSet. |
System.UInt32 | dynamicOffsetsCount | The number of dynamic offsets being used. This must be equal to the number of dynamic buffers (DynamicBinding) contained in the ResourceSet. |
System.UInt32 | dynamicOffsets | A reference to the first of a series of offsets which will be applied to the dynamic buffers contained in the ResourceSet. These offsets are applied in the order that dynamic buffer elements appear in the ResourceSet. Each of these offsets must be a multiple of either UniformBufferMinOffsetAlignment or StructuredBufferMinOffsetAlignment, depending on the kind of resource. |
SetGraphicsResourceSet(UInt32, ResourceSet, UInt32[])
Sets the active ResourceSet for the given index. This ResourceSet is only active for the graphics Pipeline.
Declaration
public void SetGraphicsResourceSet(uint slot, ResourceSet rs, uint[] dynamicOffsets)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | The resource slot. |
ResourceSet | rs | The new ResourceSet. |
System.UInt32[] | dynamicOffsets | An array containing the offsets to apply to the dynamic buffers contained in the ResourceSet. The number of elements in this array must be equal to the number of dynamic buffers (DynamicBinding) contained in the ResourceSet. These offsets are applied in the order that dynamic buffer elements appear in the ResourceSet. Each of these offsets must be a multiple of either UniformBufferMinOffsetAlignment or StructuredBufferMinOffsetAlignment, depending on the kind of resource. |
SetGraphicsResourceSetCore(UInt32, ResourceSet, UInt32, ref UInt32)
Declaration
protected abstract void SetGraphicsResourceSetCore(uint slot, ResourceSet rs, uint dynamicOffsetsCount, ref uint dynamicOffsets)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | slot | |
ResourceSet | rs | |
System.UInt32 | dynamicOffsetsCount | |
System.UInt32 | dynamicOffsets |
SetIndexBuffer(DeviceBuffer, IndexFormat)
Sets the active DeviceBuffer. When drawing, an DeviceBuffer must be bound.
Declaration
public void SetIndexBuffer(DeviceBuffer buffer, IndexFormat format)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The new DeviceBuffer. |
IndexFormat | format | The format of data in the DeviceBuffer. |
SetIndexBuffer(DeviceBuffer, IndexFormat, UInt32)
Sets the active DeviceBuffer. When drawing, an DeviceBuffer must be bound.
Declaration
public void SetIndexBuffer(DeviceBuffer buffer, IndexFormat format, uint offset)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The new DeviceBuffer. |
IndexFormat | format | The format of data in the DeviceBuffer. |
System.UInt32 | offset | The offset from the start of the buffer, in bytes, from which data will start to be read. |
SetPipeline(Pipeline)
Sets the active Pipeline used for rendering. When drawing, the active Pipeline must be compatible with the bound Framebuffer, ResourceSet, and DeviceBuffer objects. When a new Pipeline is set, the previously-bound ResourceSets on this CommandList become invalidated and must be re-bound.
Declaration
public void SetPipeline(Pipeline pipeline)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The new Pipeline object. |
SetScissorRect(UInt32, UInt32, UInt32, UInt32, UInt32)
Sets the active scissor rectangle at the given index. The index given must be less than the number of color attachments in the active Framebuffer.
Declaration
public abstract void SetScissorRect(uint index, uint x, uint y, uint width, uint height)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The color target index. |
System.UInt32 | x | The X value of the scissor rectangle. |
System.UInt32 | y | The Y value of the scissor rectangle. |
System.UInt32 | width | The width of the scissor rectangle. |
System.UInt32 | height | The height of the scissor rectangle. |
SetVertexBuffer(UInt32, DeviceBuffer)
Sets the active DeviceBuffer for the given index. When drawing, the bound DeviceBuffer objects must be compatible with the bound Pipeline. The given buffer must be non-null. It is not necessary to un-bind vertex buffers for Pipelines which will not use them. All extra vertex buffers are simply ignored.
Declaration
public void SetVertexBuffer(uint index, DeviceBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The buffer slot. |
DeviceBuffer | buffer | The new DeviceBuffer. |
SetVertexBuffer(UInt32, DeviceBuffer, UInt32)
Sets the active DeviceBuffer for the given index. When drawing, the bound DeviceBuffer objects must be compatible with the bound Pipeline. The given buffer must be non-null. It is not necessary to un-bind vertex buffers for Pipelines which will not use them. All extra vertex buffers are simply ignored.
Declaration
public void SetVertexBuffer(uint index, DeviceBuffer buffer, uint offset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The buffer slot. |
DeviceBuffer | buffer | The new DeviceBuffer. |
System.UInt32 | offset | The offset from the start of the buffer, in bytes, from which data will start to be read. |
SetViewport(UInt32, Viewport)
Sets the active Viewport at the given index. The index given must be less than the number of color attachments in the active Framebuffer.
Declaration
public void SetViewport(uint index, Viewport viewport)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The color target index. |
Viewport | viewport | The new Viewport. |
SetViewport(UInt32, ref Viewport)
Sets the active Viewport at the given index. The index given must be less than the number of color attachments in the active Framebuffer.
Declaration
public abstract void SetViewport(uint index, ref Viewport viewport)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The color target index. |
Viewport | viewport | The new Viewport. |
UpdateBuffer(DeviceBuffer, UInt32, IntPtr, UInt32)
Updates a DeviceBuffer region with new data.
Declaration
public void UpdateBuffer(DeviceBuffer buffer, uint bufferOffsetInBytes, IntPtr source, uint sizeInBytes)
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The resource to update. |
System.UInt32 | bufferOffsetInBytes | An offset, in bytes, from the beginning of the DeviceBuffer's storage, at which new data will be uploaded. |
System.IntPtr | source | A pointer to the start of the data to upload. |
System.UInt32 | sizeInBytes | The total size of the uploaded data, in bytes. |
UpdateBuffer<T>(DeviceBuffer, UInt32, T)
Updates a DeviceBuffer region with new data.
This function must be used with a blittable value type T
.
Declaration
public void UpdateBuffer<T>(DeviceBuffer buffer, uint bufferOffsetInBytes, T source)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The resource to update. |
System.UInt32 | bufferOffsetInBytes | An offset, in bytes, from the beginning of the DeviceBuffer storage, at which new data will be uploaded. |
T | source | The value to upload. |
Type Parameters
Name | Description |
---|---|
T | The type of data to upload. |
UpdateBuffer<T>(DeviceBuffer, UInt32, ref T)
Updates a DeviceBuffer region with new data.
This function must be used with a blittable value type T
.
Declaration
public void UpdateBuffer<T>(DeviceBuffer buffer, uint bufferOffsetInBytes, ref T source)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The resource to update. |
System.UInt32 | bufferOffsetInBytes | An offset, in bytes, from the beginning of the DeviceBuffer's storage, at which new data will be uploaded. |
T | source | A reference to the single value to upload. |
Type Parameters
Name | Description |
---|---|
T | The type of data to upload. |
UpdateBuffer<T>(DeviceBuffer, UInt32, ref T, UInt32)
Updates a DeviceBuffer region with new data.
This function must be used with a blittable value type T
.
Declaration
public void UpdateBuffer<T>(DeviceBuffer buffer, uint bufferOffsetInBytes, ref T source, uint sizeInBytes)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The resource to update. |
System.UInt32 | bufferOffsetInBytes | An offset, in bytes, from the beginning of the DeviceBuffer's storage, at which new data will be uploaded. |
T | source | A reference to the first of a series of values to upload. |
System.UInt32 | sizeInBytes | The total size of the uploaded data, in bytes. |
Type Parameters
Name | Description |
---|---|
T | The type of data to upload. |
UpdateBuffer<T>(DeviceBuffer, UInt32, T[])
Updates a DeviceBuffer region with new data.
This function must be used with a blittable value type T
.
Declaration
public void UpdateBuffer<T>(DeviceBuffer buffer, uint bufferOffsetInBytes, T[] source)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
DeviceBuffer | buffer | The resource to update. |
System.UInt32 | bufferOffsetInBytes | An offset, in bytes, from the beginning of the DeviceBuffer's storage, at which new data will be uploaded. |
T[] | source | An array containing the data to upload. |
Type Parameters
Name | Description |
---|---|
T | The type of data to upload. |