Class CommandBuffer
A command buffer stores commands until the buffer is committed for execution by the GPU. Command buffers are transient, single-use objects and do not support reuse.
Inheritance
Implements
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public abstract class CommandBuffer : IGetNativePointers
Fields
InRenderPass
Indicates whether in a render pass or false in other cases.
Declaration
protected bool InRenderPass
Field Value
Type | Description |
---|---|
bool |
Properties
AvailablePointerKeys
Gets a list of all available keys to obtain native pointers.
Declaration
public virtual IEnumerable<string> AvailablePointerKeys { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
GraphicsContext
Gets the generic graphics context.
Declaration
protected abstract GraphicsContext GraphicsContext { get; }
Property Value
Type | Description |
---|---|
GraphicsContext |
Name
Gets or sets a string identifying this instance. Can be used in graphics debugging tools.
Declaration
public abstract string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
State
Gets or sets the state of this command buffer.
Declaration
public CommandBuffer.CommandBufferState State { get; protected set; }
Property Value
Type | Description |
---|---|
CommandBuffer.CommandBufferState |
Methods
Begin()
Sets the initial state for this command buffer. This function must be called before other graphics commands can be issued.
Declaration
public abstract void Begin()
BeginDebugMarker(string)
Marks the beginning of a section of event code. This allows subsequent commands to be categorized and filtered when viewed in external debugging tools.
Declaration
public abstract void BeginDebugMarker(string label)
Parameters
Type | Name | Description |
---|---|---|
string | label | String that contains the name of the event. |
Remarks
Call the EndDebugMarker method to mark the end of the section of event code. BeginDebugMarker has no effect if the calling application is not running under an enabled profiling tool.
BeginQuery(QueryHeap, uint)
Begins a GPU query.
Declaration
public abstract void BeginQuery(QueryHeap heap, uint index)
Parameters
Type | Name | Description |
---|---|---|
QueryHeap | heap | Specifies the query heap containing the query. |
uint | index | The query index. |
Remarks
This method works only with occlusion and binaryOcclusion query heap types.
BeginRenderPass(ref RenderPassDescription)
Begin a render pass.
Declaration
public void BeginRenderPass(ref RenderPassDescription description)
Parameters
Type | Name | Description |
---|---|---|
RenderPassDescription | description | The RenderPass description RenderPassDescription. |
BeginRenderPassInternal(ref RenderPassDescription)
Begins a render pass.
Declaration
protected abstract void BeginRenderPassInternal(ref RenderPassDescription description)
Parameters
Type | Name | Description |
---|---|---|
RenderPassDescription | description | The render pass description RenderPassDescription. |
Blit(Texture, Texture)
Copies all subresources from this texture to another texture with format conversion and prepares it for presentation in a swapchain.
Declaration
public void Blit(Texture source, Texture destination)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture. |
Texture | destination | The destination Texture into which data is copied. |
Blit(Texture, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint)
Copies all subresources from this texture to another texture with format conversion, preparing it to present in the swapchain.
Declaration
protected abstract void Blit(Texture source, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBasedArrayLayer, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArrayLayer, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture. |
uint | sourceX | The x-coordinate of the upper-left corner of the source region. |
uint | sourceY | The y-coordinate of the upper-left corner of the source region. |
uint | sourceZ | The z-coordinate of the upper-left corner of the source region. |
uint | sourceMipLevel | The mip level to copy from the source texture. |
uint | sourceBasedArrayLayer | The starting array layer to copy from the source texture. |
Texture | destination | The destination Texture into which data is copied. |
uint | destinationX | The x-coordinate of the upper-left corner of the destination region. |
uint | destinationY | The y-coordinate of the upper-left corner of the destination region. |
uint | destinationZ | The z-coordinate of the upper-left corner of the destination region. |
uint | destinationMipLevel | The mip level to copy the data into. |
uint | destinationBasedArrayLayer | The starting array layer to copy data into. |
uint | layerCount | The number of array layers to copy. |
BuildRaytracingAccelerationStructure(BottomLevelASDescription)
Performs a bottom level acceleration structure build on the GPU.
Declaration
public abstract BottomLevelAS BuildRaytracingAccelerationStructure(BottomLevelASDescription blas)
Parameters
Type | Name | Description |
---|---|---|
BottomLevelASDescription | blas | Bottom level acceleration structure description. |
Returns
Type | Description |
---|---|
BottomLevelAS | Bottom level acceleration structure. |
BuildRaytracingAccelerationStructure(TopLevelASDescription)
Performs a top-level acceleration structure build on the GPU.
Declaration
public abstract TopLevelAS BuildRaytracingAccelerationStructure(TopLevelASDescription tlas)
Parameters
Type | Name | Description |
---|---|---|
TopLevelASDescription | tlas | Top-level acceleration structure description. |
Returns
Type | Description |
---|---|
TopLevelAS | Top-level Acceleration Structure. |
ClearCache()
Clears all cached values of this command buffer.
Declaration
protected virtual void ClearCache()
Commit()
Commits this command buffer to the command queue, waiting to be executed on the GPU after Submit().
Declaration
public abstract void Commit()
CopyBufferDataTo(Buffer, Buffer, uint, uint, uint)
Copies this buffer to the destination buffer.
Declaration
public void CopyBufferDataTo(Buffer origin, Buffer destination, uint sizeInBytes, uint sourceOffset = 0, uint destinationOffset = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | origin | The origin buffer. |
Buffer | destination | The destination buffer. |
uint | sizeInBytes | The data size in bytes to copy. |
uint | sourceOffset | The source buffer offset in bytes. |
uint | destinationOffset | The destination buffer offset in bytes. |
CopyBufferDataToInternal(Buffer, Buffer, uint, uint, uint)
Copies this buffer to the destination buffer.
Declaration
protected abstract void CopyBufferDataToInternal(Buffer origin, Buffer destination, uint sizeInBytes, uint sourceOffset = 0, uint destinationOffset = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | origin | The origin buffer. |
Buffer | destination | The destination buffer. |
uint | sizeInBytes | The data size in bytes to copy. |
uint | sourceOffset | The source buffer offset in bytes. |
uint | destinationOffset | The destination buffer offset in bytes. |
CopyTextureDataTo(Texture, Texture)
Copies all subresources from this texture to another texture.
Declaration
public void CopyTextureDataTo(Texture source, Texture destination)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture. |
Texture | destination | The destination Texture into which data is copied. |
CopyTextureDataTo(Texture, Texture, uint, uint)
Copies one subresource from this texture to another texture.
Declaration
public void CopyTextureDataTo(Texture source, Texture destination, uint mipLevel, uint arrayLayer)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture. |
Texture | destination | The destination Texture into which data is copied. |
uint | mipLevel | The mip level to copy. |
uint | arrayLayer | The array layer to copy. |
CopyTextureDataTo(Texture, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint, uint, uint, uint)
Copies a region from this texture to another texture.
Declaration
public void CopyTextureDataTo(Texture source, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBasedArrayLayer, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArrayLayer, uint width, uint height, uint depth, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture. |
uint | sourceX | The x-coordinate of the upper left corner of the source region. |
uint | sourceY | The y-coordinate of the upper left corner of the source region. |
uint | sourceZ | The z-coordinate of the upper left corner of the source region. |
uint | sourceMipLevel | The mip level to copy from the source texture. |
uint | sourceBasedArrayLayer | The starting array layer to copy from the source texture. |
Texture | destination | The destination Texture into which data is copied. |
uint | destinationX | The x-coordinate of the upper left corner of the destination region. |
uint | destinationY | The y-coordinate of the upper left corner of the destination region. |
uint | destinationZ | The z-coordinate of the upper left corner of the destination region. |
uint | destinationMipLevel | The mip level to copy the data into. |
uint | destinationBasedArrayLayer | The starting array layer to copy data into. |
uint | width | The width in texels of the copy region. |
uint | height | The height in texels of the copy region. |
uint | depth | The depth in texels of the copy region. |
uint | layerCount | The number of array layers to copy. |
CopyTextureDataToInternal(Texture, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint, uint, uint, uint)
Copies a region from this texture to another texture.
Declaration
protected abstract void CopyTextureDataToInternal(Texture source, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBasedArrayLayer, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArrayLayer, uint width, uint height, uint depth, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | The source Texture. |
uint | sourceX | The x-coordinate of the upper left corner of the source region. |
uint | sourceY | The y-coordinate of the upper left corner of the source region. |
uint | sourceZ | The z-coordinate of the upper left corner of the source region. |
uint | sourceMipLevel | The mip level to copy from the source texture. |
uint | sourceBasedArrayLayer | The starting array layer to copy from the source texture. |
Texture | destination | The destination Texture into which data is copied. |
uint | destinationX | The x-coordinate of the upper left corner of the destination region. |
uint | destinationY | The y-coordinate of the upper left corner of the destination region. |
uint | destinationZ | The z-coordinate of the upper left corner of the destination region. |
uint | destinationMipLevel | The mip level to copy the data into. |
uint | destinationBasedArrayLayer | The starting array layer to copy data into. |
uint | width | The width in texels of the copy region. |
uint | height | The height in texels of the copy region. |
uint | depth | The depth in texels of the copy region. |
uint | layerCount | The number of array layers to copy. |
Dispatch(uint, uint, uint)
Execute commands in a compute shader from a thread group.
Declaration
public abstract void Dispatch(uint groupCountX, uint groupCountY, uint groupCountZ)
Parameters
Type | Name | Description |
---|---|---|
uint | groupCountX | The number of groups dispatched in the x direction. groupSizeX must be less than or equal to 65535. |
uint | groupCountY | The number of groups dispatched in the y direction. groupSizeY must be less than or equal to 65535. |
uint | groupCountZ | The number of groups dispatched in the z direction. groupSizeZ must be less than or equal to 65535. |
Remarks
You call the Dispatch method to execute commands in a compute shader. A compute shader can be run on many threads in parallel within a thread group. Index a particular thread within a thread group using a 3D vector given by (x, y, z).
Dispatch1D(uint, uint)
Executes commands in a compute shader to solve a 1D problem.
Declaration
public void Dispatch1D(uint threadCountX, uint groupSizeX = 64)
Parameters
Type | Name | Description |
---|---|---|
uint | threadCountX | The size of the problem. |
uint | groupSizeX | The group size, 64 by default. |
Dispatch2D(uint, uint, uint, uint)
Executes commands in a compute shader to solve a 2D problem.
Declaration
public void Dispatch2D(uint threadCountX, uint threadCountY, uint groupSizeX = 8, uint groupSizeY = 8)
Parameters
Type | Name | Description |
---|---|---|
uint | threadCountX | The x-size of the problem. |
uint | threadCountY | The y-size of the problem. |
uint | groupSizeX | The group size x, 8 by default. |
uint | groupSizeY | The group size y, 8 by default. |
Dispatch3D(uint, uint, uint, uint, uint, uint)
Executes commands in a compute shader to solve a 3D problem.
Declaration
public void Dispatch3D(uint threadCountX, uint threadCountY, uint threadCountZ, uint groupSizeX, uint groupSizeY, uint groupSizeZ)
Parameters
Type | Name | Description |
---|---|---|
uint | threadCountX | The x size of the problem. |
uint | threadCountY | The y size of the problem. |
uint | threadCountZ | The z size of the problem. |
uint | groupSizeX | The group size in the x dimension. |
uint | groupSizeY | The group size in the y dimension. |
uint | groupSizeZ | The group size in the z dimension. |
DispatchIndirect(Buffer, uint)
Executes a command list over one or more thread groups.
Declaration
public abstract void DispatchIndirect(Buffer argBuffer, uint offset)
Parameters
Type | Name | Description |
---|---|---|
Buffer | argBuffer | A buffer that must be loaded with data matching the argument list for Dispatch(uint, uint, uint). |
uint | offset | A byte-aligned offset between the start of the buffer and the arguments. |
DispatchRays(DispatchRaysDescription)
Launches threads of a ray generation shader. See Initiating Raytracing for an overview. Can be called from graphics or compute command lists and bundles.
Declaration
public abstract void DispatchRays(DispatchRaysDescription description)
Parameters
Type | Name | Description |
---|---|---|
DispatchRaysDescription | description | Dispatch rays description. |
Dispose()
Performs tasks associated with freeing, releasing, or resetting unmanaged resources defined by the application.
Declaration
public abstract void Dispose()
Draw(uint, uint)
Draw non-indexed, non-instanced primitives.
Declaration
public abstract void Draw(uint vertexCount, uint startVertexLocation = 0)
Parameters
Type | Name | Description |
---|---|---|
uint | vertexCount | The number of vertices to draw. |
uint | startVertexLocation | The index of the first vertex, which is usually an offset in a vertex buffer. |
DrawIndexed(uint, uint, uint)
Draws indexed, non-instanced primitives.
Declaration
public abstract void DrawIndexed(uint indexCount, uint startIndexLocation = 0, uint baseVertexLocation = 0)
Parameters
Type | Name | Description |
---|---|---|
uint | indexCount | The number of indices to draw. |
uint | startIndexLocation | The location of the first index read by the GPU from the index buffer. |
uint | baseVertexLocation | A value added to each index before reading a vertex from the vertex buffer. |
DrawIndexedInstanced(uint, uint, uint, uint, uint)
Draws indexed, instanced primitives.
Declaration
public abstract void DrawIndexedInstanced(uint indexCountPerInstance, uint instanceCount, uint startIndexLocation = 0, uint baseVertexLocation = 0, uint startInstanceLocation = 0)
Parameters
Type | Name | Description |
---|---|---|
uint | indexCountPerInstance | The number of indices read from the index buffer for each instance. |
uint | instanceCount | The number of instances to draw. |
uint | startIndexLocation | The location of the first index read by the GPU from the index buffer. |
uint | baseVertexLocation | A value added to each index before reading a vertex from the vertex buffer. |
uint | startInstanceLocation | A value added to each index before reading per-instance data from a vertex buffer. |
DrawIndexedInstancedIndirect(Buffer, uint, uint, uint)
Draw indexed, instanced, GPU-generated primitives.
Declaration
public abstract void DrawIndexedInstancedIndirect(Buffer argBuffer, uint offset, uint drawCount, uint stride)
Parameters
Type | Name | Description |
---|---|---|
Buffer | argBuffer | A buffer containing the GPU-generated primitives. |
uint | offset | Offset to the start of the GPU-generated primitives. |
uint | drawCount | The number of draws to execute, which can be zero. |
uint | stride | The byte stride between successive sets of draw parameters. |
DrawInstanced(uint, uint, uint, uint)
Draws non-indexed, instanced primitives.
Declaration
public abstract void DrawInstanced(uint vertexCountPerInstance, uint instanceCount, uint startVertexLocation = 0, uint startInstanceLocation = 0)
Parameters
Type | Name | Description |
---|---|---|
uint | vertexCountPerInstance | Number of vertices to draw. |
uint | instanceCount | Number of instances to draw. |
uint | startVertexLocation | Index of the first vertex. |
uint | startInstanceLocation | A value added to each index before reading per-instance data from a vertex buffer. |
DrawInstancedIndirect(Buffer, uint, uint, uint)
Draws instanced, GPU-generated primitives.
Declaration
public abstract void DrawInstancedIndirect(Buffer argBuffer, uint offset, uint drawCount, uint stride)
Parameters
Type | Name | Description |
---|---|---|
Buffer | argBuffer | A buffer containing the GPU-generated primitives. |
uint | offset | The offset to the start of the GPU-generated primitives. |
uint | drawCount | The number of draws to execute, which can be zero. |
uint | stride | The byte stride between successive sets of draw parameters. |
End()
Completes the command buffer.
Declaration
public void End()
EndDebugMarker()
Marks the end of a section of event code.
Declaration
public abstract void EndDebugMarker()
Remarks
EndDebugMarker has no effect if the calling application is not running under an enabled profiling tool.
EndInternal()
Finalizes the command buffer.
Declaration
protected abstract void EndInternal()
EndQuery(QueryHeap, uint)
Ends a GPU query.
Declaration
public abstract void EndQuery(QueryHeap heap, uint index)
Parameters
Type | Name | Description |
---|---|---|
QueryHeap | heap | Specifies the query heap containing the query. |
uint | index | The query index. |
Remarks
This method works only with occlusion and binaryOcclusion query heap types.
EndRenderPass()
Ends a render pass.
Declaration
public void EndRenderPass()
EndRenderPassInternal()
Ends a render pass.
Declaration
protected abstract void EndRenderPassInternal()
GenerateMipmaps(Texture)
Generates mipmaps for the given Texture. The largest mipmap is used to generate all the lower mipmap levels contained in the Texture.
Declaration
public abstract void GenerateMipmaps(Texture texture)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | The Texture to generate mipmaps for. This Texture must have been created with TextureFlags.GenerateMipmaps. |
GetNativePointer(string, out nint)
Obtains a native pointer for this graphics context using the given key.
Declaration
public virtual bool GetNativePointer(string pointerKey, out nint nativePointer)
Parameters
Type | Name | Description |
---|---|---|
string | pointerKey | The pointer key. |
nint | nativePointer | The native pointer. |
Returns
Type | Description |
---|---|
bool | True if there is an available pointer with this key. |
InsertDebugMarker(string)
Marks a single point of execution in the code. This is used by graphics debuggers to identify points of interest in a command stream.
Declaration
public abstract void InsertDebugMarker(string label)
Parameters
Type | Name | Description |
---|---|---|
string | label | String that contains the name of the event. |
Remarks
InsertDebugMarker has no effect if the calling application is not running under an enabled profiling tool.
Reset()
Resets the command buffer to the initial state.
Declaration
public abstract void Reset()
ResolveTexture(Texture, Texture)
Resolve a multisampled texture into a non-multisampled texture.
Declaration
public abstract void ResolveTexture(Texture source, Texture destination)
Parameters
Type | Name | Description |
---|---|---|
Texture | source | Source multisampled texture. |
Texture | destination | Non-multisampled texture. |
ResourceBarrierUnorderedAccessView(Buffer)
Sets a resource barrier for a texture.
Declaration
public abstract void ResourceBarrierUnorderedAccessView(Buffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The texture buffer. |
ResourceBarrierUnorderedAccessView(Texture)
Sets a resource barrier for a texture.
Declaration
public abstract void ResourceBarrierUnorderedAccessView(Texture texture)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | The texture. |
SetComputePipelineState(ComputePipelineState)
Sets the compute pipeline state object for this command buffer.
Declaration
public void SetComputePipelineState(ComputePipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
ComputePipelineState | pipeline | The compute pipeline state description. |
SetComputePipelineStateInternal(ComputePipelineState)
Sets the compute pipeline state object for this command buffer.
Declaration
protected abstract void SetComputePipelineStateInternal(ComputePipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
ComputePipelineState | pipeline | The compute pipeline state description. |
SetGraphicsPipelineState(GraphicsPipelineState)
Sets the graphics pipeline state object for this command buffer.
Declaration
public void SetGraphicsPipelineState(GraphicsPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
GraphicsPipelineState | pipeline | The graphics pipeline state description. |
SetGraphicsPipelineStateInternal(GraphicsPipelineState)
Sets the graphics pipeline state object for this command buffer.
Declaration
protected abstract void SetGraphicsPipelineStateInternal(GraphicsPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
GraphicsPipelineState | pipeline | The graphics pipeline state description. |
SetIndexBuffer(Buffer, IndexFormat, uint)
Sets an array of index buffers to the input-assembler stage.
Declaration
public void SetIndexBuffer(Buffer buffer, IndexFormat format = IndexFormat.UInt16, uint offset = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The buffer being bound. |
IndexFormat | format | Index data type (default UInt16). |
uint | offset | Offset (in bytes) from the start of the index buffer to the first index to use. |
SetIndexBufferInternal(Buffer, IndexFormat, uint)
Sets an array of index buffers to the input-assembler stage.
Declaration
protected abstract void SetIndexBufferInternal(Buffer buffer, IndexFormat format = IndexFormat.UInt16, uint offset = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The buffer being bound. |
IndexFormat | format | Indices data type (default UInt16). |
uint | offset | Offset (in bytes) from the start of the index buffer to the first index to use. |
SetRaytracingPipelineState(RaytracingPipelineState)
Sets the raytracing pipeline state object for this command buffer.
Declaration
public void SetRaytracingPipelineState(RaytracingPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
RaytracingPipelineState | pipeline | The raytracing pipeline state description. |
SetRaytracingPipelineStateInternal(RaytracingPipelineState)
Sets the ray tracing pipeline state object for this command buffer.
Declaration
protected abstract void SetRaytracingPipelineStateInternal(RaytracingPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
RaytracingPipelineState | pipeline | The ray tracing pipeline state description. |
SetResourceSet(ResourceSet, uint, uint[])
Sets the active ResourceSet for the given index.
Declaration
public void SetResourceSet(ResourceSet resourceSet, uint index = 0, uint[] constantBufferOffsets = null)
Parameters
Type | Name | Description |
---|---|---|
ResourceSet | resourceSet | The new ResourceSet. |
uint | index | The resourceSet index. |
uint[] | constantBufferOffsets | Array of values specifying the constant buffer offsets. |
SetResourceSetInternal(ResourceSet, uint, uint[])
Sets the active ResourceSet for the given index.
Declaration
protected abstract void SetResourceSetInternal(ResourceSet resourceSet, uint index = 0, uint[] constantBufferOffsets = null)
Parameters
Type | Name | Description |
---|---|---|
ResourceSet | resourceSet | The new ResourceSet. |
uint | index | The resource set index. |
uint[] | constantBufferOffsets | Array of values specifying the constant buffer offsets. |
SetScissorRectangles(Rectangle[])
Sets a scissor rectangle in a specific slot.
Declaration
public abstract void SetScissorRectangles(Rectangle[] rectangles)
Parameters
Type | Name | Description |
---|---|---|
Rectangle[] | rectangles | The array of scissor rectangles. |
SetVertexBuffer(uint, Buffer, uint)
Sets a buffer to the input-assembler stage.
Declaration
public void SetVertexBuffer(uint slot, Buffer buffer, uint offset)
Parameters
Type | Name | Description |
---|---|---|
uint | slot | The buffer slot. |
Buffer | buffer | The buffer being bound. |
uint | offset | Offset (in bytes) from the start of the buffer to the first vertex to use. |
SetVertexBufferInternal(uint, Buffer, uint)
Sets buffers to the input-assembler stage.
Declaration
protected abstract void SetVertexBufferInternal(uint slot, Buffer buffer, uint offset)
Parameters
Type | Name | Description |
---|---|---|
uint | slot | The buffer slot. |
Buffer | buffer | The buffer being bound. |
uint | offset | Offset (in bytes) from the start of the buffer to the first vertex to use. |
SetVertexBuffers(Buffer[])
Sets an array of vertex buffers to the input-assembler stage.
Declaration
public void SetVertexBuffers(Buffer[] buffers)
Parameters
Type | Name | Description |
---|---|---|
Buffer[] | buffers | The array of vertex buffers being bound. |
SetVertexBuffers(Buffer[], int[])
Sets an array of buffers to the input-assembler stage.
Declaration
public void SetVertexBuffers(Buffer[] buffers, int[] offsets)
Parameters
Type | Name | Description |
---|---|---|
Buffer[] | buffers | The array of vertex buffers being bound. |
int[] | offsets | Offsets (in bytes) from the start of each vertex buffer to the first vertex to use. |
SetVertexBuffersInternal(Buffer[], int[])
Sets an array of buffers to the input-assembler stage.
Declaration
protected abstract void SetVertexBuffersInternal(Buffer[] buffers, int[] offsets)
Parameters
Type | Name | Description |
---|---|---|
Buffer[] | buffers | The array of vertex buffers being bound. |
int[] | offsets | Offsets (in bytes) from the start of each vertex buffer to the first vertex to use. |
SetViewports(Viewport[])
Sets a viewport in a specific slot.
Declaration
public abstract void SetViewports(Viewport[] viewports)
Parameters
Type | Name | Description |
---|---|---|
Viewport[] | viewports | An array of viewports. |
UpdateBufferData(Buffer, nint, uint, uint)
Fills the buffer from a pointer.
Declaration
public void UpdateBufferData(Buffer buffer, nint source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer instance. |
nint | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | destinationOffsetInBytes | The offset in bytes. |
UpdateBufferDataInternal(Buffer, nint, uint, uint)
Fills the buffer from a pointer.
Declaration
protected abstract void UpdateBufferDataInternal(Buffer buffer, nint source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer instance. |
nint | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | destinationOffsetInBytes | The offset in bytes. |
UpdateBufferData<T>(Buffer, ref T, uint)
Fills the buffer with a data array.
Declaration
public void UpdateBufferData<T>(Buffer buffer, ref T data, uint destinationOffsetInBytes = 0) where T : struct
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The buffer instance. |
T | data | The data array. |
uint | destinationOffsetInBytes | The destination offset in bytes. |
Type Parameters
Name | Description |
---|---|
T | The data type. |
UpdateBufferData<T>(Buffer, T[], uint)
Fills the buffer with a data array.
Declaration
public void UpdateBufferData<T>(Buffer buffer, T[] data, uint destinationOffsetInBytes = 0) where T : struct
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The buffer instance. |
T[] | data | The data array. |
uint | destinationOffsetInBytes | The destination offset in bytes. |
Type Parameters
Name | Description |
---|---|
T | The data type. |
UpdateBufferData<T>(Buffer, T[], uint, uint)
Fills the buffer with a data array.
Declaration
public void UpdateBufferData<T>(Buffer buffer, T[] data, uint count, uint destinationOffsetInBytes = 0) where T : struct
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The buffer instance. |
T[] | data | The data array. |
uint | count | The number of elements. |
uint | destinationOffsetInBytes | The destination offset in bytes. |
Type Parameters
Name | Description |
---|---|
T | The data type. |
UpdateRaytracingAccelerationStructure(ref TopLevelAS, TopLevelASDescription)
Refit a top-level acceleration structure built on the GPU.
Declaration
public abstract void UpdateRaytracingAccelerationStructure(ref TopLevelAS tlas, TopLevelASDescription newDescription)
Parameters
Type | Name | Description |
---|---|---|
TopLevelAS | tlas | Top-level acceleration structure. |
TopLevelASDescription | newDescription | New top-level description. |
WriteTimestamp(QueryHeap, uint)
Writes a device timestamp into a query heap.
Declaration
public abstract void WriteTimestamp(QueryHeap heap, uint index)
Parameters
Type | Name | Description |
---|---|---|
QueryHeap | heap | Specifies the query heap. |
uint | index | The query index. |
Remarks
This method works only with timestamp query heap type.