Class CommandBuffer
A command buffer stores commands until the buffer is committed for execution by the GPU. CommandBuffers are transient single-use objects and do not support reuse.
Inheritance
Inherited Members
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public abstract class CommandBuffer : IDisposable, IGetNativePointers
Fields
InRenderPass
Whether in a renderPass or false in other case.
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 graphicsContext.
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 debuggers tools.
Declaration
public abstract string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
State
Gets or sets the state of this commandbuffer.
Declaration
public CommandBuffer.CommandBufferState State { get; protected set; }
Property Value
Type | Description |
---|---|
CommandBuffer.CommandBufferState |
Methods
Begin()
Set the initialize state for this commandbuffer. This function must be called before other graphics commands ca 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
You 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 queryheap containing the query. |
uint | index | The query index. |
Remarks
This method works only with occusion and binaryOcclusion queryheap 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)
Begin a render pass.
Declaration
protected abstract void BeginRenderPassInternal(ref RenderPassDescription description)
Parameters
Type | Name | Description |
---|---|---|
RenderPassDescription | description | The renderPass description RenderPassDescription. |
Blit(Texture, Texture)
Copies all subresources from this texture in other texture with format conversion and preparing to present in 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 in other texture with format conversion and preparing to present in 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)
Perform an 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)
Perform an 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. |
Commit()
Commits this command buffer to the command queue waiting to be execute on GPU after Submit().
Declaration
public abstract void Commit()
CopyBufferDataTo(Buffer, Buffer, uint, uint, uint)
Copy this buffer in 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)
Copy this buffer in 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 in other 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 in other 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 in other 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 in other 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)
Execute 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)
Execute 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)
Execute 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 x. |
uint | groupSizeY | The group size y. |
uint | groupSizeZ | The group size z. |
DispatchIndirect(Buffer, uint)
Execute 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 which must be loaded with data that matches 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)
Launch 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 application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
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 | Number of vertices to draw. |
uint | startVertexLocation | Index of the first vertex, which is usually an offset in a vertex buffer. |
DrawIndexed(uint, uint, uint)
Draw indexed, non-instanced primitives.
Declaration
public abstract void DrawIndexed(uint indexCount, uint startIndexLocation = 0, uint baseVertexLocation = 0)
Parameters
Type | Name | Description |
---|---|---|
uint | indexCount | 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)
Draw 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 | Number of indices read from the index buffer for each instance. |
uint | instanceCount | 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 | It is the number of draws to execute, and can be zero. |
uint | stride | It is the byte stride between succesive sets of draw parameters. |
DrawInstanced(uint, uint, uint, uint)
Draw 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)
Draw 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 | Offset to the start of the GPU generated primitives. |
uint | drawCount | It is the number of draws to execute, and can be zero. |
uint | stride | It is the byte stride between succesive 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()
Completes 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 queryheap containing the query. |
uint | index | The query index. |
Remarks
This method works only with occusion and binaryOcclusion queryheap types.
EndRenderPass()
End a render pass.
Declaration
public void EndRenderPass()
EndRenderPassInternal()
End a render pass.
Declaration
protected abstract void EndRenderPassInternal()
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.
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 IntPtr)
Obtain a native pointer of this graphics context using the given key.
Declaration
public virtual bool GetNativePointer(string pointerKey, out IntPtr nativePointer)
Parameters
Type | Name | Description |
---|---|---|
string | pointerKey | The pointer key. |
IntPtr | nativePointer | The native pointer. |
Returns
Type | Description |
---|---|
bool | True if there are an available pointer with this key. |
InsertDebugMarker(string)
Marks a single point of execution in 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()
Reset the command buffer to the initial state.
Declaration
public abstract void Reset()
ResourceBarrierUnorderedAccessView(Buffer)
Sets a resource barrier for a texture.
Declaration
public abstract void ResourceBarrierUnorderedAccessView(Buffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | The 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 commandbuffer.
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 commandbuffer.
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 commandbuffer.
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 commandbuffer.
Declaration
protected abstract void SetGraphicsPipelineStateInternal(GraphicsPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
GraphicsPipelineState | pipeline | The graphics pipeline state description. |
SetIndexBuffer(Buffer, IndexFormat, uint)
Set an array of index buffers to the input-assembler stage.
Declaration
public abstract void SetIndexBuffer(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 commandbuffer.
Declaration
public void SetRaytracingPipelineState(RaytracingPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
RaytracingPipelineState | pipeline | The raytracing pipeline state description. |
SetRaytracingPipelineStateInternal(RaytracingPipelineState)
Sets the raytracing pipeline state object for this commandbuffer.
Declaration
protected abstract void SetRaytracingPipelineStateInternal(RaytracingPipelineState pipeline)
Parameters
Type | Name | Description |
---|---|---|
RaytracingPipelineState | pipeline | The raytracing pipeline state description. |
SetResourceSet(ResourceSet, uint, uint[])
Set the active ResourceSet for the given index.
Declaration
public abstract 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. |
SetScissorRectangles(Rectangle[])
Set an scissor rectangle in a specific slot.
Declaration
public abstract void SetScissorRectangles(Rectangle[] rectangles)
Parameters
Type | Name | Description |
---|---|---|
Rectangle[] | rectangles | The array of the scissor rectangles. |
SetVertexBuffer(uint, Buffer, uint)
Set an buffers to the input-assembler stage.
Declaration
public abstract 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 buffer to the first vertex to use. |
SetVertexBuffers(Buffer[])
Set 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 the vertex buffers being bound. |
SetVertexBuffers(Buffer[], int[])
Set an array of buffers to the input-assembler stage.
Declaration
public abstract void SetVertexBuffers(Buffer[] buffers, int[] offsets)
Parameters
Type | Name | Description |
---|---|---|
Buffer[] | buffers | The array of the vertex buffers being bound. |
int[] | offsets | Offsets (in bytes) from the start of each vertexbuffer to the first vertex to use. |
SetViewports(Viewport[])
Set a viewport in a specific slot.
Declaration
public abstract void SetViewports(Viewport[] viewports)
Parameters
Type | Name | Description |
---|---|---|
Viewport[] | viewports | The array of the viewports. |
UpdateBufferData(Buffer, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
public void UpdateBufferData(Buffer buffer, IntPtr source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer instance. |
IntPtr | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | destinationOffsetInBytes | The offset in bytes. |
UpdateBufferDataInternal(Buffer, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
protected abstract void UpdateBufferDataInternal(Buffer buffer, IntPtr source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer instance. |
IntPtr | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | destinationOffsetInBytes | The offset in bytes. |
UpdateBufferData<T>(Buffer, ref T, uint)
Fill 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 | Buffer instance. |
T | data | The data array. |
uint | destinationOffsetInBytes | The destination offset. |
Type Parameters
Name | Description |
---|---|
T | The data type. |
UpdateBufferData<T>(Buffer, T[], uint)
Fill 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 | Buffer instance. |
T[] | data | The data array. |
uint | destinationOffsetInBytes | The destination offset. |
Type Parameters
Name | Description |
---|---|
T | The data type. |
UpdateBufferData<T>(Buffer, T[], uint, uint)
Fill 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 | Buffer instance. |
T[] | data | The data array. |
uint | count | The number of elements. |
uint | destinationOffsetInBytes | The destination offset. |
Type Parameters
Name | Description |
---|---|
T | The data type. |
UpdateRaytracingAccelerationStructure(ref TopLevelAS, TopLevelASDescription)
Refit an top level accelerations structure build 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)
Write a device timestamp into a query heap.
Declaration
public abstract void WriteTimestamp(QueryHeap heap, uint index)
Parameters
Type | Name | Description |
---|---|---|
QueryHeap | heap | Specifies the queryheap. |
uint | index | The query index. |
Remarks
This method works only with timestamp queryheap type.