 |
GpuStagingBuffer Class |
GpuStagingBuffer is a special buffer in graphics card's memory that can be written by CPU and can be used to copy its content to GPU local memory.
GpuStagingBuffer batches the data write commands so that they are executed only once.
When
AutomaticallyWriteDataWhenFull is true (by default) this happens when the buffer is full.
This also happens when
WriteToGpu(Boolean, Boolean) method is called.
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.CoreAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.2.9386+3a404a3e1ebfa4efd231da7fe6f10dfb23b95dc4
Syntaxpublic class GpuStagingBuffer : GpuBuffer
The GpuStagingBuffer type exposes the following members.
Constructors
Properties
Methods| | Name | Description |
|---|
 | AddDataT(T, GpuBuffer, Int32) |
AddData add the specified data to this GpuStagingBuffer.
When AutomaticallyWriteDataWhenFull is true (by default), then this method calls WriteToGpu(Boolean, Boolean) method is called when the buffer is full.
If AutomaticallyWriteDataWhenFull is false and user adds more data that the size of the bufer, then an exception is thrown.
After calling this method the IsDataWritePostponed on the destinationBuffer is set to true (until the data is actually written to the buffer).
|
 | AddDataT(T, GpuBuffer, Int32) |
AddData add the specified data to this GpuStagingBuffer.
When AutomaticallyWriteDataWhenFull is true (by default), then this method calls WriteToGpu(Boolean, Boolean) method is called when the buffer is full.
If AutomaticallyWriteDataWhenFull is false and user adds more data that the size of the bufer, then an exception is thrown.
After calling this method the IsDataWritePostponed on the destinationBuffer is set to true (until the data is actually written to the buffer).
|
 | AddDataT(ReadOnlySpan, Void, T) | |
 | AddDataT(Span, Void, T) | |
 | AddDataT(T, Int32, GpuBuffer, Int32) |
AddData add the specified data to this GpuStagingBuffer.
When AutomaticallyWriteDataWhenFull is true (by default), then this method calls WriteToGpu(Boolean, Boolean) method is called when the buffer is full.
If AutomaticallyWriteDataWhenFull is false and user adds more data that the size of the bufer, then an exception is thrown.
After calling this method the IsDataWritePostponed on the destinationBuffer is set to true (until the data is actually written to the buffer).
|
 | Dispose |
Dispose
(Overrides GpuBufferDispose(Boolean)) |
 | WaitUntilAllDataWritten |
When WriteToGpu(Boolean, Boolean) is called with waitUntilFinished set to false,
then this method can wait until all commands are finished and new data can be added to this GpuStagingBuffer again.
This method will also write to GPU all additional data that was added after the call to WriteToGpu.
|
 | WriteToGpu |
WriteToGpu method fills the command buffer with buffer copy commands, submits it to the queue and waits until all the commands are executed (when waitUntilFinished parameter is true).
Note that when waitUntilFinished is false, user must not add new data to this GpuStagingBuffer before the command has finished executing
(user can call WaitUntilAllDataWritten to make sure that all the commands have finished executing).
|
Top
See Also