Class DX12Buffer
Represents a DirectX buffer object.
Inherited Members
Namespace: Evergine.DirectX12
Assembly: Evergine.DirectX12.dll
Syntax
public class DX12Buffer : Buffer
Constructors
DX12Buffer(DX12GraphicsContext, nint, ref BufferDescription)
Initializes a new instance of the DX12Buffer class.
Declaration
public DX12Buffer(DX12GraphicsContext context, nint data, ref BufferDescription description)
Parameters
| Type | Name | Description |
|---|---|---|
| DX12GraphicsContext | context | The graphics context. |
| nint | data | The data pointer. |
| BufferDescription | description | The buffer description. |
Fields
NativeBuffer
The DirectX texture instance.
Declaration
public ID3D12Resource NativeBuffer
Field Value
| Type | Description |
|---|---|
| ID3D12Resource |
nativeResourceState
Represents the DirectX resource state.
Declaration
public ResourceStates nativeResourceState
Field Value
| Type | Description |
|---|---|
| ResourceStates |
Properties
ConstantBufferView
Gets the constant buffer view.
Declaration
public CpuDescriptorHandle ConstantBufferView { get; }
Property Value
| Type | Description |
|---|---|
| CpuDescriptorHandle |
Name
Gets or sets a string identifying this instance. It can be used in graphics debugging tools.
Declaration
public override string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
NativePointer
Gets the native pointer.
Declaration
public override nint NativePointer { get; }
Property Value
| Type | Description |
|---|---|
| nint |
Overrides
ShaderResourceView
Gets the shader resource view.
Declaration
public CpuDescriptorHandle ShaderResourceView { get; }
Property Value
| Type | Description |
|---|---|
| CpuDescriptorHandle |
UnorderedAccessView
Gets the unordered view.
Declaration
public CpuDescriptorHandle UnorderedAccessView { get; }
Property Value
| Type | Description |
|---|---|
| CpuDescriptorHandle |
Methods
CopyTo(ID3D12GraphicsCommandList, Buffer, uint, uint, uint)
Copy this buffer to the destination buffer.
Declaration
public void CopyTo(ID3D12GraphicsCommandList commandList, Buffer destination, uint sizeInBytes, uint sourceOffset = 0, uint destinationOffset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ID3D12GraphicsCommandList | commandList | The command list where commands are executed. |
| 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. |
Destroy()
Destroy graphics native resources.
Declaration
protected override void Destroy()
Overrides
ResourceTransition(ID3D12GraphicsCommandList, ResourceStates, uint)
Transition this buffer to a new state.
Declaration
public void ResourceTransition(ID3D12GraphicsCommandList commandList, ResourceStates newResourceState, uint subResource = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ID3D12GraphicsCommandList | commandList | The command list used to execute the barrier transition. |
| ResourceStates | newResourceState | The new state to set. |
| uint | subResource | The subresource of this buffer. |
SetData(ID3D12GraphicsCommandList, nint, uint, uint)
Fills the buffer from a pointer.
Declaration
public void SetData(ID3D12GraphicsCommandList commandList, nint source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ID3D12GraphicsCommandList | commandList | The command list where commands are executed. |
| nint | source | The data pointer. |
| uint | sourceSizeInBytes | The size in bytes. |
| uint | destinationOffsetInBytes | The offset in bytes. |
ToStaging()
Returns a new Buffer with ResourceUsage set to staging.
Declaration
public DX12Buffer ToStaging()
Returns
| Type | Description |
|---|---|
| DX12Buffer | New staging Buffer. |