![]() |
Paradox Game Engine
v1.0.0 beta06
|
All-in-One Buffer class linked SharpDX.Direct3D11.Buffer. More...
Classes | |
class | Argument |
Argument buffer helper methods. More... | |
class | Cosntant |
Constant buffer helper methods. More... | |
class | Index |
Index buffer helper methods. More... | |
class | Raw |
Raw buffer helper methods. More... | |
class | Structured |
Structured buffer helper methods. More... | |
class | StructuredAppend |
StructuredAppend buffer helper methods. More... | |
class | StructuredCounter |
StructuredCounter buffer helper methods. More... | |
class | Typed |
Typed buffer helper methods. More... | |
class | Vertex |
Vertex buffer helper methods. More... | |
Public Member Functions | |
Buffer | ToStaging () |
Return an equivalent staging texture CPU read-writable from this instance. More... | |
Buffer | Clone () |
Clones this instance. More... | |
TData[] | GetData< TData > () |
Gets the content of this buffer to an array of data. More... | |
void | GetData< TData > (TData[] toData) |
Copies the content of this buffer to an array of data. More... | |
void | GetData< TData > (ref TData toData) |
Copies the content of this buffer to an array of data. More... | |
unsafe void | GetData< TData > (Buffer stagingTexture, ref TData toData) |
Copies the content of this buffer from GPU memory to an array of data on CPU memory using a specific staging resource. More... | |
unsafe void | GetData< TData > (Buffer stagingTexture, TData[] toData) |
Copies the content of this buffer from GPU memory to an array of data on CPU memory using a specific staging resource. More... | |
void | SetData< TData > (ref TData fromData, int offsetInBytes=0) |
Copies the content of a single structure data from CPU memory to this buffer into GPU memory. More... | |
unsafe void | SetData< TData > (TData[] fromData, int offsetInBytes=0) |
Copies the content an array of data from CPU memory to this buffer into GPU memory. More... | |
void | SetData (DataPointer fromData, int offsetInBytes=0) |
Copies the content an array of data on CPU memory to this buffer into GPU memory. More... | |
unsafe void | SetData< TData > (GraphicsDevice device, ref TData fromData, int offsetInBytes=0) |
Copies the content an array of data on CPU memory to this buffer into GPU memory. More... | |
unsafe void | SetData< TData > (GraphicsDevice device, TData[] fromData, int offsetInBytes=0) |
Copies the content an array of data on CPU memory to this buffer into GPU memory. More... | |
void | GetData (Buffer stagingTexture, DataPointer toData) |
Copies the content of this buffer from GPU memory to a CPU memory using a specific staging resource. More... | |
void | SetData (GraphicsDevice device, DataPointer fromData, int offsetInBytes=0) |
Copies the content an array of data on CPU memory to this buffer into GPU memory. More... | |
Buffer | RecreateWith< T > (T[] dataPointer) |
Reload Buffer from given data if GraphicsDevice has been reset. More... | |
Buffer | RecreateWith (IntPtr dataPointer) |
Reload Buffer from given data if GraphicsDevice has been reset. More... | |
void | Recreate< T > (T[] dataPointer) |
Explicitly recreate buffer with given data. Usually called after a GraphicsDevice reset. More... | |
![]() | |
void | Dispose () |
override string | ToString () |
Static Public Member Functions | |
static Buffer | New (GraphicsDevice device, BufferDescription description, PixelFormat viewFormat=PixelFormat.None) |
Creates a new Buffer instance. More... | |
static Buffer | New (GraphicsDevice device, int bufferSize, BufferFlags bufferFlags, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer< T > | New< T > (GraphicsDevice device, int elementCount, BufferFlags bufferFlags, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer | New (GraphicsDevice device, int bufferSize, BufferFlags bufferFlags, PixelFormat viewFormat, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer | New (GraphicsDevice device, int bufferSize, int elementSize, BufferFlags bufferFlags, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer | New (GraphicsDevice device, int bufferSize, int elementSize, BufferFlags bufferFlags, PixelFormat viewFormat, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer< T > | New< T > (GraphicsDevice device, ref T value, BufferFlags bufferFlags, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static unsafe Buffer< T > | New< T > (GraphicsDevice device, ref T value, BufferFlags bufferFlags, PixelFormat viewFormat, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer< T > | New< T > (GraphicsDevice device, T[] initialValue, BufferFlags bufferFlags, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static unsafe Buffer< T > | New< T > (GraphicsDevice device, T[] initialValue, BufferFlags bufferFlags, PixelFormat viewFormat, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static unsafe Buffer | New (GraphicsDevice device, byte[] initialValue, int elementSize, BufferFlags bufferFlags, PixelFormat viewFormat=PixelFormat.None, GraphicsResourceUsage usage=GraphicsResourceUsage.Immutable) |
Creates a new Buffer instance from a byte array. More... | |
static Buffer | New (GraphicsDevice device, DataPointer dataPointer, int elementSize, BufferFlags bufferFlags, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
static Buffer | New (GraphicsDevice device, DataPointer dataPointer, int elementSize, BufferFlags bufferFlags, PixelFormat viewFormat, GraphicsResourceUsage usage=GraphicsResourceUsage.Default) |
Creates a new Buffer instance. More... | |
Public Attributes | |
readonly BufferDescription | Description |
Gets the description of this buffer. More... | |
readonly BufferFlags | BufferFlags |
Gets the type of this belementCount /// More... | |
readonly PixelFormat | ViewFormat |
Gets the default view format of this buffer. More... | |
![]() | |
Action< GraphicsResourceBase > | Reload |
![]() | |
PropertyContainer | Tags |
Gets the attached properties to this component. More... | |
Protected Attributes | |
int | elementCount |
Properties | |
int | ElementCount [get, set] |
Gets the number of elements. More... | |
![]() | |
GraphicsDevice | GraphicsDevice [get, set] |
Gets the graphics device attached to this instance. More... | |
![]() | |
long | Id [get, set] |
string | Name [get, set] |
Gets or sets the name of this component. More... | |
bool | IsDisposed [get, set] |
Has the component been disposed or not yet. More... | |
![]() | |
long | Id [get] |
Gets the id of this component. More... | |
string | Name [get] |
Gets the name of this component. More... | |
![]() | |
int | ReferenceCount [get] |
Gets the reference count of this instance. More... | |
![]() | |
ObjectCollector | Collector [get] |
Gets the collector. More... | |
Additional Inherited Members | |
![]() | |
GraphicsResource () | |
GraphicsResource (GraphicsDevice device) | |
GraphicsResource (GraphicsDevice device, string name) | |
![]() | |
GraphicsResourceBase () | |
Initializes a new instance of the GraphicsResourceBase class. More... | |
GraphicsResourceBase (GraphicsDevice device) | |
Initializes a new instance of the GraphicsResourceBase class. More... | |
GraphicsResourceBase (GraphicsDevice device, string name) | |
Initializes a new instance of the GraphicsResourceBase class. More... | |
override void | Destroy () |
Disposes of object resources. More... | |
![]() | |
ComponentBase () | |
Initializes a new instance of the ComponentBase class. More... | |
ComponentBase (string name) | |
Initializes a new instance of the ComponentBase class. More... | |
virtual void | OnNameChanged () |
Called when Name property was changed. More... | |
All-in-One Buffer class linked SharpDX.Direct3D11.Buffer.
This class is able to create constant buffers, indexelementCountrtex buffers, structured buffer, raw buffers, argument buffers.
Definition at line 26 of file Buffer.Argument.cs.
Buffer SiliconStudio.Paradox.Graphics.Buffer.Clone | ( | ) |
void SiliconStudio.Paradox.Graphics.Buffer.GetData | ( | Buffer | stagingTexture, |
DataPointer | toData | ||
) |
Copies the content of this buffer from GPU memory to a CPU memory using a specific staging resource.
stagingTexture | The staging buffer used to transfer the buffer. |
toData | To data pointer. |
System.ArgumentException | When strides is different from optimal strides, and TData is not the same size as the pixel format, or Width * Height != toData.Length |
This method is only working when called from the main thread that is accessing the main GraphicsDevice.
Definition at line 278 of file Buffer.cs.
References SiliconStudio.Paradox.Graphics.DataPointer.Size.
TData [] SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > | ( | ) |
Gets the content of this buffer to an array of data.
TData | The type of the T data. |
This method is only working when called from the main thread that is accessing the main GraphicsDevice. This method creates internally a stagging resource if this texture is not already a stagging resouce, copies to it and map it to memory. Use method with explicit staging resource for optimal performances.
TData | : | struct |
void SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > | ( | TData[] | toData | ) |
Copies the content of this buffer to an array of data.
TData | The type of the T data. |
toData | The destination buffer to receive a copy of the texture datas. |
This method is only working when called from the main thread that is accessing the main GraphicsDevice. This method creates internally a stagging resource if this texture is not already a stagging resouce, copies to it and map it to memory. Use method with explicit staging resource for optimal performances.
TData | : | struct |
void SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > | ( | ref TData | toData | ) |
Copies the content of this buffer to an array of data.
TData | The type of the T data. |
toData | The destination buffer to receive a copy of the texture datas. |
This method is only working when called from the main thread that is accessing the main GraphicsDevice. This method creates internally a stagging resource if this texture is not already a stagging resouce, copies to it and map it to memory. Use method with explicit staging resource for optimal performances.
TData | : | struct |
unsafe void SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > | ( | Buffer | stagingTexture, |
ref TData | toData | ||
) |
Copies the content of this buffer from GPU memory to an array of data on CPU memory using a specific staging resource.
TData | The type of the T data. |
stagingTexture | The staging buffer used to transfer the buffer. |
toData | To data. |
System.ArgumentException | When strides is different from optimal strides, and TData is not the same size as the pixel format, or Width * Height != toData.Length |
This method is only working when called from the main thread that is accessing the main GraphicsDevice.
TData | : | struct |
unsafe void SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > | ( | Buffer | stagingTexture, |
TData[] | toData | ||
) |
Copies the content of this buffer from GPU memory to an array of data on CPU memory using a specific staging resource.
TData | The type of the T data. |
stagingTexture | The staging buffer used to transfer the buffer. |
toData | To data. |
System.ArgumentException | When strides is different from optimal strides, and TData is not the same size as the pixel format, or Width * Height != toData.Length |
This method is only working when called from the main thread that is accessing the main GraphicsDevice.
TData | : | struct |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
description | The description of the buffer. |
viewFormat | View format used if the buffer is used as a shared resource view. |
Definition at line 343 of file Buffer.cs.
Referenced by SiliconStudio.Paradox.Effects.Model.FromGeometricMeshData< T >(), SiliconStudio.Paradox.Effects.SkyBoxPlugin.Load(), SiliconStudio.Paradox.Effects.SlideShowPlugin.Load(), and SiliconStudio.Paradox.Effects.Modules.Renderers.LightingPrepassRenderer.Load().
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
bufferSize | Size of the buffer in bytes. |
bufferFlags | The buffer flags to specify the type of buffer. |
usage | The usage. |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
bufferSize | Size of the buffer in bytes. |
bufferFlags | The buffer flags to specify the type of buffer. |
viewFormat | The view format must be specified if the buffer is declared as a shared resource view. |
usage | The usage. |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
bufferSize | Size of the buffer in bytes. |
elementSize | Size of an element in the buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
usage | The usage. |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
bufferSize | Size of the buffer in bytes. |
elementSize | Size of an element in the buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
viewFormat | The view format must be specified if the buffer is declared as a shared resource view. |
usage | The usage. |
|
static |
Creates a new Buffer instance from a byte array.
device | The GraphicsDevice. |
initialValue | The initial value of this buffer. |
elementSize | Size of an element. Must be equal to 2 or 4 for an index buffer, or to the size of a struct for a structured/typed buffer. Can be set to 0 for other buffers. |
bufferFlags | The buffer flags to specify the type of buffer. |
viewFormat | The view format must be specified if the buffer is declared as a shared resource view. |
usage | The usage. |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
dataPointer | The data pointer. |
elementSize | Size of the element. |
bufferFlags | The buffer flags to specify the type of buffer. |
usage | The usage. |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
dataPointer | The data pointer. |
elementSize | Size of the element. |
bufferFlags | The buffer flags to specify the type of buffer. |
viewFormat | The view format must be specified if the buffer is declared as a shared resource view. |
usage | The usage. |
Definition at line 536 of file Buffer.cs.
References SiliconStudio.Paradox.Graphics.DataPointer.Pointer.
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
elementCount | Number of T elment in this buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
usage | The usage. |
T | : | struct |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
T | Type of the buffer, to get the sizeof from. |
value | The initial value of this buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
usage | The usage. |
T | : | struct |
|
static |
Creates a new Buffer instance.
device | The GraphicsDevice. |
T | Type of the buffer, to get the sizeof from. |
value | The initial value of this buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
viewFormat | The view format must be specified if the buffer is declared as a shared resource view. |
usage | The usage. |
T | : | struct |
|
static |
Creates a new Buffer instance.
T | Type of the buffer, to get the sizeof from. |
device | The GraphicsDevice. |
initialValue | The initial value of this buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
usage | The usage. |
T | : | struct |
|
static |
Creates a new Buffer instance.
T | Type of the buffer, to get the sizeof from. |
device | The GraphicsDevice. |
initialValue | The initial value of this buffer. |
bufferFlags | The buffer flags to specify the type of buffer. |
viewFormat | The view format must be specified if the buffer is declared as a shared resource view. |
usage | The usage. |
T | : | struct |
void SiliconStudio.Paradox.Graphics.Buffer.Recreate< T > | ( | T[] | dataPointer | ) |
Explicitly recreate buffer with given data. Usually called after a GraphicsDevice reset.
T |
dataPointer |
T | : | struct |
Buffer SiliconStudio.Paradox.Graphics.Buffer.RecreateWith | ( | IntPtr | dataPointer | ) |
Reload Buffer from given data if GraphicsDevice has been reset.
T |
dataPointer | The data pointer. |
Buffer SiliconStudio.Paradox.Graphics.Buffer.RecreateWith< T > | ( | T[] | dataPointer | ) |
Reload Buffer from given data if GraphicsDevice has been reset.
T |
dataPointer | The data pointer. |
T | : | struct |
void SiliconStudio.Paradox.Graphics.Buffer.SetData | ( | DataPointer | fromData, |
int | offsetInBytes = 0 |
||
) |
Copies the content an array of data on CPU memory to this buffer into GPU memory.
fromData | A data pointer. |
offsetInBytes | The offset in bytes to write to. |
System.ArgumentException |
This method is only working when called from the main thread that is accessing the main GraphicsDevice. See the unmanaged documentation about Map/UnMap for usage and restrictions.
void SiliconStudio.Paradox.Graphics.Buffer.SetData | ( | GraphicsDevice | device, |
DataPointer | fromData, | ||
int | offsetInBytes = 0 |
||
) |
Copies the content an array of data on CPU memory to this buffer into GPU memory.
device | The GraphicsDevice. |
fromData | A data pointer. |
offsetInBytes | The offset in bytes to write to. |
System.ArgumentException |
See the unmanaged documentation about Map/UnMap for usage and restrictions.
Definition at line 305 of file Buffer.cs.
References SiliconStudio.Paradox.Graphics.DataPointer.Pointer, and SiliconStudio.Paradox.Graphics.DataPointer.Size.
void SiliconStudio.Paradox.Graphics.Buffer.SetData< TData > | ( | ref TData | fromData, |
int | offsetInBytes = 0 |
||
) |
Copies the content of a single structure data from CPU memory to this buffer into GPU memory.
TData | The type of the T data. |
fromData | The data to copy from. |
offsetInBytes | The offset in bytes to write to. |
System.ArgumentException |
This method is only working when called from the main thread that is accessing the main GraphicsDevice. See the unmanaged documentation about Map/UnMap for usage and restrictions.
TData | : | struct |
unsafe void SiliconStudio.Paradox.Graphics.Buffer.SetData< TData > | ( | TData[] | fromData, |
int | offsetInBytes = 0 |
||
) |
Copies the content an array of data from CPU memory to this buffer into GPU memory.
TData | The type of the T data. |
fromData | The data to copy from. |
offsetInBytes | The offset in bytes to write to. |
System.ArgumentException |
This method is only working when called from the main thread that is accessing the main GraphicsDevice. See the unmanaged documentation about Map/UnMap for usage and restrictions.
TData | : | struct |
unsafe void SiliconStudio.Paradox.Graphics.Buffer.SetData< TData > | ( | GraphicsDevice | device, |
ref TData | fromData, | ||
int | offsetInBytes = 0 |
||
) |
Copies the content an array of data on CPU memory to this buffer into GPU memory.
TData | The type of the T data. |
device | The GraphicsDevice. |
fromData | The data to copy from. |
offsetInBytes | The offset in bytes to write to. |
System.ArgumentException |
See the unmanaged documentation about Map/UnMap for usage and restrictions.
TData | : | struct |
unsafe void SiliconStudio.Paradox.Graphics.Buffer.SetData< TData > | ( | GraphicsDevice | device, |
TData[] | fromData, | ||
int | offsetInBytes = 0 |
||
) |
Copies the content an array of data on CPU memory to this buffer into GPU memory.
TData | The type of the T data. |
device | The GraphicsDevice. |
fromData | The data to copy from. |
offsetInBytes | The offset in bytes to write to. |
System.ArgumentException |
See the unmanaged documentation about Map/UnMap for usage and restrictions.
TData | : | struct |
Buffer SiliconStudio.Paradox.Graphics.Buffer.ToStaging | ( | ) |
readonly BufferFlags SiliconStudio.Paradox.Graphics.Buffer.BufferFlags |
readonly BufferDescription SiliconStudio.Paradox.Graphics.Buffer.Description |
Gets the description of this buffer.
Definition at line 44 of file Buffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.Data.BufferDataConverter.ConvertToData().
|
protected |
readonly PixelFormat SiliconStudio.Paradox.Graphics.Buffer.ViewFormat |
|
getset |