Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Paradox.Graphics.Buffer Class Reference

All-in-One Buffer class linked SharpDX.Direct3D11.Buffer. More...

Inheritance diagram for SiliconStudio.Paradox.Graphics.Buffer:
SiliconStudio.Paradox.Graphics.GraphicsResource SiliconStudio.Paradox.Graphics.GraphicsResourceBase SiliconStudio.Core.ComponentBase SiliconStudio.Core.IComponent SiliconStudio.Core.ICollectorHolder SiliconStudio.Core.IReferencable SiliconStudio.Core.IReferencable SiliconStudio.Paradox.Graphics.Buffer< T >

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...
 
- Public Member Functions inherited from SiliconStudio.Core.ComponentBase
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...
 
- Public Attributes inherited from SiliconStudio.Paradox.Graphics.GraphicsResourceBase
Action< GraphicsResourceBaseReload
 
- Public Attributes inherited from SiliconStudio.Core.ComponentBase
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...
 
- Properties inherited from SiliconStudio.Paradox.Graphics.GraphicsResourceBase
GraphicsDevice GraphicsDevice [get, set]
 Gets the graphics device attached to this instance. More...
 
- Properties inherited from SiliconStudio.Core.ComponentBase
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...
 
- Properties inherited from SiliconStudio.Core.IComponent
long Id [get]
 Gets the id of this component. More...
 
string Name [get]
 Gets the name of this component. More...
 
- Properties inherited from SiliconStudio.Core.IReferencable
int ReferenceCount [get]
 Gets the reference count of this instance. More...
 
- Properties inherited from SiliconStudio.Core.ICollectorHolder
ObjectCollector Collector [get]
 Gets the collector. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SiliconStudio.Paradox.Graphics.GraphicsResource
 GraphicsResource ()
 
 GraphicsResource (GraphicsDevice device)
 
 GraphicsResource (GraphicsDevice device, string name)
 
- Protected Member Functions inherited from SiliconStudio.Paradox.Graphics.GraphicsResourceBase
 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...
 
- Protected Member Functions inherited from SiliconStudio.Core.ComponentBase
 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...
 

Detailed Description

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.

Member Function Documentation

Buffer SiliconStudio.Paradox.Graphics.Buffer.Clone ( )

Clones this instance.

Returns
A clone of this instance

This method will not copy the content of the buffer to the clone

Definition at line 92 of file Buffer.cs.

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.

Parameters
stagingTextureThe staging buffer used to transfer the buffer.
toDataTo data pointer.
Exceptions
System.ArgumentExceptionWhen 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.

Gets the content of this buffer to an array of data.

Template Parameters
TDataThe 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.

Type Constraints
TData :struct 

Definition at line 105 of file Buffer.cs.

void SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > ( TData[]  toData)

Copies the content of this buffer to an array of data.

Template Parameters
TDataThe type of the T data.
Parameters
toDataThe 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.

Type Constraints
TData :struct 

Definition at line 121 of file Buffer.cs.

void SiliconStudio.Paradox.Graphics.Buffer.GetData< TData > ( ref TData  toData)

Copies the content of this buffer to an array of data.

Template Parameters
TDataThe type of the T data.
Parameters
toDataThe 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.

Type Constraints
TData :struct 

Definition at line 146 of file Buffer.cs.

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.

Template Parameters
TDataThe type of the T data.
Parameters
stagingTextureThe staging buffer used to transfer the buffer.
toDataTo data.
Exceptions
System.ArgumentExceptionWhen 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.

Type Constraints
TData :struct 

Definition at line 172 of file Buffer.cs.

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.

Template Parameters
TDataThe type of the T data.
Parameters
stagingTextureThe staging buffer used to transfer the buffer.
toDataTo data.
Exceptions
System.ArgumentExceptionWhen 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.

Type Constraints
TData :struct 

Definition at line 187 of file Buffer.cs.

static Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
BufferDescription  description,
PixelFormat  viewFormat = PixelFormat.None 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
descriptionThe description of the buffer.
viewFormatView format used if the buffer is used as a shared resource view.
Returns
An instance of a new Buffer

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 Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
int  bufferSize,
BufferFlags  bufferFlags,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
bufferSizeSize of the buffer in bytes.
bufferFlagsThe buffer flags to specify the type of buffer.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 357 of file Buffer.cs.

static Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
int  bufferSize,
BufferFlags  bufferFlags,
PixelFormat  viewFormat,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
bufferSizeSize of the buffer in bytes.
bufferFlagsThe buffer flags to specify the type of buffer.
viewFormatThe view format must be specified if the buffer is declared as a shared resource view.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 388 of file Buffer.cs.

static Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
int  bufferSize,
int  elementSize,
BufferFlags  bufferFlags,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
bufferSizeSize of the buffer in bytes.
elementSizeSize of an element in the buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 402 of file Buffer.cs.

static Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
int  bufferSize,
int  elementSize,
BufferFlags  bufferFlags,
PixelFormat  viewFormat,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
bufferSizeSize of the buffer in bytes.
elementSizeSize of an element in the buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
viewFormatThe view format must be specified if the buffer is declared as a shared resource view.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 417 of file Buffer.cs.

static unsafe Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
byte[]  initialValue,
int  elementSize,
BufferFlags  bufferFlags,
PixelFormat  viewFormat = PixelFormat.None,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Immutable 
)
static

Creates a new Buffer instance from a byte array.

Parameters
deviceThe GraphicsDevice.
initialValueThe initial value of this buffer.
elementSizeSize 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.
bufferFlagsThe buffer flags to specify the type of buffer.
viewFormatThe view format must be specified if the buffer is declared as a shared resource view.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 503 of file Buffer.cs.

static Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
DataPointer  dataPointer,
int  elementSize,
BufferFlags  bufferFlags,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
dataPointerThe data pointer.
elementSizeSize of the element.
bufferFlagsThe buffer flags to specify the type of buffer.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 521 of file Buffer.cs.

static Buffer SiliconStudio.Paradox.Graphics.Buffer.New ( GraphicsDevice  device,
DataPointer  dataPointer,
int  elementSize,
BufferFlags  bufferFlags,
PixelFormat  viewFormat,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
dataPointerThe data pointer.
elementSizeSize of the element.
bufferFlagsThe buffer flags to specify the type of buffer.
viewFormatThe view format must be specified if the buffer is declared as a shared resource view.
usageThe usage.
Returns
An instance of a new Buffer

Definition at line 536 of file Buffer.cs.

References SiliconStudio.Paradox.Graphics.DataPointer.Pointer.

static Buffer<T> SiliconStudio.Paradox.Graphics.Buffer.New< T > ( GraphicsDevice  device,
int  elementCount,
BufferFlags  bufferFlags,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
elementCountNumber of T elment in this buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
usageThe usage.
Returns
An instance of a new Buffer
Type Constraints
T :struct 

Definition at line 370 of file Buffer.cs.

static Buffer<T> SiliconStudio.Paradox.Graphics.Buffer.New< T > ( GraphicsDevice  device,
ref T  value,
BufferFlags  bufferFlags,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
Template Parameters
TType of the buffer, to get the sizeof from.
Parameters
valueThe initial value of this buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
usageThe usage.
Returns
An instance of a new Buffer
Type Constraints
T :struct 

Definition at line 433 of file Buffer.cs.

static unsafe Buffer<T> SiliconStudio.Paradox.Graphics.Buffer.New< T > ( GraphicsDevice  device,
ref T  value,
BufferFlags  bufferFlags,
PixelFormat  viewFormat,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Parameters
deviceThe GraphicsDevice.
Template Parameters
TType of the buffer, to get the sizeof from.
Parameters
valueThe initial value of this buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
viewFormatThe view format must be specified if the buffer is declared as a shared resource view.
usageThe usage.
Returns
An instance of a new Buffer
Type Constraints
T :struct 

Definition at line 448 of file Buffer.cs.

static Buffer<T> SiliconStudio.Paradox.Graphics.Buffer.New< T > ( GraphicsDevice  device,
T[]  initialValue,
BufferFlags  bufferFlags,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Template Parameters
TType of the buffer, to get the sizeof from.
Parameters
deviceThe GraphicsDevice.
initialValueThe initial value of this buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
usageThe usage.
Returns
An instance of a new Buffer
Type Constraints
T :struct 

Definition at line 468 of file Buffer.cs.

static unsafe Buffer<T> SiliconStudio.Paradox.Graphics.Buffer.New< T > ( GraphicsDevice  device,
T[]  initialValue,
BufferFlags  bufferFlags,
PixelFormat  viewFormat,
GraphicsResourceUsage  usage = GraphicsResourceUsage.Default 
)
static

Creates a new Buffer instance.

Template Parameters
TType of the buffer, to get the sizeof from.
Parameters
deviceThe GraphicsDevice.
initialValueThe initial value of this buffer.
bufferFlagsThe buffer flags to specify the type of buffer.
viewFormatThe view format must be specified if the buffer is declared as a shared resource view.
usageThe usage.
Returns
An instance of a new Buffer
Type Constraints
T :struct 

Definition at line 483 of file Buffer.cs.

void SiliconStudio.Paradox.Graphics.Buffer.Recreate< T > ( T[]  dataPointer)

Explicitly recreate buffer with given data. Usually called after a GraphicsDevice reset.

Template Parameters
T
Parameters
dataPointer
Type Constraints
T :struct 

Definition at line 597 of file Buffer.cs.

Buffer SiliconStudio.Paradox.Graphics.Buffer.RecreateWith ( IntPtr  dataPointer)

Reload Buffer from given data if GraphicsDevice has been reset.

Template Parameters
T
Parameters
dataPointerThe data pointer.
Returns
This instance.

Definition at line 585 of file Buffer.cs.

Reload Buffer from given data if GraphicsDevice has been reset.

Template Parameters
T
Parameters
dataPointerThe data pointer.
Returns
This instance.
Type Constraints
T :struct 

Definition at line 572 of file Buffer.cs.

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.

Parameters
fromDataA data pointer.
offsetInBytesThe offset in bytes to write to.
Exceptions
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.

Definition at line 231 of file Buffer.cs.

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.

Parameters
deviceThe GraphicsDevice.
fromDataA data pointer.
offsetInBytesThe offset in bytes to write to.
Exceptions
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.

Template Parameters
TDataThe type of the T data.
Parameters
fromDataThe data to copy from.
offsetInBytesThe offset in bytes to write to.
Exceptions
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.

Type Constraints
TData :struct 

Definition at line 202 of file Buffer.cs.

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.

Template Parameters
TDataThe type of the T data.
Parameters
fromDataThe data to copy from.
offsetInBytesThe offset in bytes to write to.
Exceptions
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.

Type Constraints
TData :struct 

Definition at line 217 of file Buffer.cs.

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.

Template Parameters
TDataThe type of the T data.
Parameters
deviceThe GraphicsDevice.
fromDataThe data to copy from.
offsetInBytesThe offset in bytes to write to.
Exceptions
System.ArgumentException

See the unmanaged documentation about Map/UnMap for usage and restrictions.

Type Constraints
TData :struct 

Definition at line 247 of file Buffer.cs.

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.

Template Parameters
TDataThe type of the T data.
Parameters
deviceThe GraphicsDevice.
fromDataThe data to copy from.
offsetInBytesThe offset in bytes to write to.
Exceptions
System.ArgumentException

See the unmanaged documentation about Map/UnMap for usage and restrictions.

Type Constraints
TData :struct 

Definition at line 263 of file Buffer.cs.

Buffer SiliconStudio.Paradox.Graphics.Buffer.ToStaging ( )

Return an equivalent staging texture CPU read-writable from this instance.

Returns
A new instance of this buffer as a staging resource

Definition at line 77 of file Buffer.cs.

Member Data Documentation

readonly BufferFlags SiliconStudio.Paradox.Graphics.Buffer.BufferFlags

Gets the type of this belementCount ///

Definition at line 66 of file Buffer.cs.

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().

int SiliconStudio.Paradox.Graphics.Buffer.elementCount
protected

Definition at line 39 of file Buffer.cs.

readonly PixelFormat SiliconStudio.Paradox.Graphics.Buffer.ViewFormat

Gets the default view format of this buffer.

Definition at line 71 of file Buffer.cs.

Property Documentation

int SiliconStudio.Paradox.Graphics.Buffer.ElementCount
getset

Gets the number of elements.

This value is valid for structured buffers, raw buffers and index buffers that are used as a SharedResourceView.

Definition at line 53 of file Buffer.cs.


The documentation for this class was generated from the following files: