Class UploadBufferDX12
Uploading data to GPU buffer utility
Inheritance
Assembly: FlaxEngine.dll
File: Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.h
Syntax
public class UploadBufferDX12
Constructors
~UploadBufferDX12()
Destructor
Declaration
public ~UploadBufferDX12()
UploadBufferDX12(GPUDeviceDX12* device)
Init
Declaration
public UploadBufferDX12(GPUDeviceDX12* device)
Parameters
GPUDeviceDX12
device
Graphics Device |
Methods
Allocate(uint64 size, uint64 align)
Allocates memory for custom data in the buffer.
Declaration
public DynamicAllocation Allocate(uint64 size, uint64 align)
Parameters
uint64
size
Size of the data in bytes |
uint64
align
Data alignment in buffer in bytes |
Returns
DynamicAllocation
Dynamic location |
BeginGeneration(uint64 generation)
Begins new generation.
Declaration
public void BeginGeneration(uint64 generation)
Parameters
uint64
generation
The generation ID to begin. |
GetCurrentGeneration()
Gets the current generation number.
Declaration
public uint64 GetCurrentGeneration() const
Returns
uint64
|
UploadBuffer(GPUContextDX12* context, ID3D12Resource* buffer, uint32 bufferOffset, const void* data, uint64 size)
Uploads data to the buffer.
Declaration
public bool UploadBuffer(GPUContextDX12* context, ID3D12Resource* buffer, uint32 bufferOffset, const void* data, uint64 size)
Parameters
GPUContextDX12
context
GPU context to record upload command to it |
ID3D12Resource
buffer
Destination buffer |
uint32
bufferOffset
Destination buffer offset in bytes. |
void
data
Data to allocate |
uint64
size
Size of the data in bytes |
Returns
bool
True if cannot upload data, otherwise false. |
UploadTexture(GPUContextDX12* context, ID3D12Resource* texture, const void* srcData, uint32 srcRowPitch, uint32 srcSlicePitch, int32 mipIndex, int32 arrayIndex)
Uploads data to the texture.
Declaration
public bool UploadTexture(GPUContextDX12* context, ID3D12Resource* texture, const void* srcData, uint32 srcRowPitch, uint32 srcSlicePitch, int32 mipIndex, int32 arrayIndex)
Parameters
GPUContextDX12
context
GPU context to record upload command to it |
ID3D12Resource
texture
Destination texture |
void
srcData
Data to allocate |
uint32
srcRowPitch
Source data row pitch value to upload. |
uint32
srcSlicePitch
Source data slice pitch value to upload. |
int32
mipIndex
Mip map to stream index |
int32
arrayIndex
Texture array index |
Returns
bool
True if cannot upload data, otherwise false. |