Class UploadBuffer
This abstract class represent and strategy to fast upload buffers to GPU.
Implements
Inherited Members
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public abstract class UploadBuffer : IDisposable
  Constructors
UploadBuffer(GraphicsContext, ulong, uint)
Initializes a new instance of the UploadBuffer class.
Declaration
public UploadBuffer(GraphicsContext context, ulong size, uint align)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GraphicsContext | context | The graphics context.  | 
      
| ulong | size | The uploadBuffer size.  | 
      
| uint | align | The uploadBuffer align if it is needed.  | 
      
Fields
Align
The buffer alignment.
Declaration
public uint Align
  Field Value
| Type | Description | 
|---|---|
| uint | 
Count
Number of batched buffers.
Declaration
public ulong Count
  Field Value
| Type | Description | 
|---|---|
| ulong | 
DataBegin
Pointer to the begin of the buffer.
Declaration
public ulong DataBegin
  Field Value
| Type | Description | 
|---|---|
| ulong | 
DataCurrent
Pointer to the current buffer position.
Declaration
public ulong DataCurrent
  Field Value
| Type | Description | 
|---|---|
| ulong | 
DataEnd
Pointer to the end of the buffer.
Declaration
public ulong DataEnd
  Field Value
| Type | Description | 
|---|---|
| ulong | 
TotalSize
The total size in bytes of the uploadbuffer.
Declaration
public ulong TotalSize
  Field Value
| Type | Description | 
|---|---|
| ulong | 
context
The graphics context instance.
Declaration
protected GraphicsContext context
  Field Value
| Type | Description | 
|---|---|
| GraphicsContext | 
Methods
Allocate(ulong)
Allocate the new data in the uploadbuffer.
Declaration
public ulong Allocate(ulong dataSize)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | dataSize | The new data size.  | 
      
Returns
| Type | Description | 
|---|---|
| ulong | The destination address to copy.  | 
      
CalculateOffset(ulong)
Gets the native address data offset.
Declaration
public ulong CalculateOffset(ulong address)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | address | The address of data.  | 
      
Returns
| Type | Description | 
|---|---|
| ulong | The address data offset.  | 
      
Clear()
Reset all pointers of the uploadbuffer.
Declaration
public void Clear()
  Dispose()
Dispose all resource of this instance.
Declaration
public abstract void Dispose()
  RefreshBuffer(ulong)
Refresh the native buffer used by the uploadbuffer with the new size.
Declaration
protected abstract void RefreshBuffer(ulong size)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | size | The new size of the buffer.  |