Class DX12Buffer
Represents a DirectX buffer object.
Implements
Inherited Members
Namespace: Evergine.DirectX12
Assembly: Evergine.DirectX12.dll
Syntax
public class DX12Buffer : Buffer, IDisposable
Constructors
DX12Buffer(DX12GraphicsContext, IntPtr, ref BufferDescription)
Initializes a new instance of the DX12Buffer class.
Declaration
public DX12Buffer(DX12GraphicsContext context, IntPtr data, ref BufferDescription description)
Parameters
| Type | Name | Description |
|---|---|---|
| DX12GraphicsContext | context | The graphics context. |
| IntPtr | data | The data pointer. |
| BufferDescription | description | A buffer description. |
Fields
NativeBuffer
The DirectX texture instance.
Declaration
public ID3D12Resource NativeBuffer
Field Value
| Type | Description |
|---|---|
| ID3D12Resource |
nativeResourceState
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. Can be used in graphics debuggers tools.
Declaration
public override string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
NativePointer
Gets the native pointer.
Declaration
public override IntPtr NativePointer { get; }
Property Value
| Type | Description |
|---|---|
| IntPtr |
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 in the destionation buffer.
Declaration
public void CopyTo(ID3D12GraphicsCommandList commandList, Buffer destination, uint sizeInBytes, uint sourceOffset = 0, uint destinationOffset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ID3D12GraphicsCommandList | commandList | The commandlist where execute commands. |
| 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 destionation buffer offset in bytes. |
Dispose()
Dispose this instance.
Declaration
public override void Dispose()
Overrides
ResourceTransition(ID3D12GraphicsCommandList, ResourceStates, int)
Transition this buffer to a new state.
Declaration
public void ResourceTransition(ID3D12GraphicsCommandList commandList, ResourceStates newResourceState, int subResource = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ID3D12GraphicsCommandList | commandList | The commandlist used to execute the barrier transition. |
| ResourceStates | newResourceState | The new state to set. |
| int | subResource | The subResource of this buffer. |
SetData(ID3D12GraphicsCommandList, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
public void SetData(ID3D12GraphicsCommandList commandList, IntPtr source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ID3D12GraphicsCommandList | commandList | The commandlist where execute commands. |
| IntPtr | source | The data pointer. |
| uint | sourceSizeInBytes | The size in bytes. |
| uint | destinationOffsetInBytes | The offset in bytes. |
ToStaging()
Return a new Buffer with ResourceUsage set to staging.
Declaration
public DX12Buffer ToStaging()
Returns
| Type | Description |
|---|---|
| DX12Buffer | New staging Buffer. |