[]
        
(Showing Draft Content)

C1.Util.DX.Direct3D11.Buffer.Create

Create Method

Create(Device, BufferDescription)

Initializes a new instance of the Buffer class.

Declaration
public static Buffer Create(Device device, BufferDescription description)
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

BufferDescription description

The description of the buffer.

Returns
Type Description
Buffer

Create(Device, DataStream, BufferDescription)

Initializes a new instance of the Buffer class.

Declaration
public static Buffer Create(Device device, DataStream data, BufferDescription description)
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

DataStream data

Initial data used to initialize the buffer.

BufferDescription description

The description of the buffer.

Returns
Type Description
Buffer

Create(Device, IntPtr, BufferDescription)

Initializes a new instance of the Buffer class.

Declaration
public static Buffer Create(Device device, IntPtr dataPointer, BufferDescription description)
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

IntPtr dataPointer

The data pointer.

BufferDescription description

The description of the buffer.

Returns
Type Description
Buffer

Create(Device, int, ResourceUsage, BindFlags, CpuAccessFlags, ResourceMiscFlags, int)

Initializes a new instance of the Buffer class.

Declaration
public static Buffer Create(Device device, int sizeInBytes, ResourceUsage usage, BindFlags bindFlags, CpuAccessFlags accessFlags, ResourceMiscFlags miscFlags, int structureByteStride)
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

int sizeInBytes

The size, in bytes, of the buffer.

ResourceUsage usage

The usage pattern for the buffer.

BindFlags bindFlags

Flags specifying how the buffer will be bound to the pipeline.

CpuAccessFlags accessFlags

Flags specifying how the buffer will be accessible from the CPU.

ResourceMiscFlags miscFlags

Miscellaneous resource options.

int structureByteStride

The size (in bytes) of the structure element for structured buffers.

Returns
Type Description
Buffer

Create(Device, DataStream, int, ResourceUsage, BindFlags, CpuAccessFlags, ResourceMiscFlags, int)

Initializes a new instance of the Buffer class.

Declaration
public static Buffer Create(Device device, DataStream data, int sizeInBytes, ResourceUsage usage, BindFlags bindFlags, CpuAccessFlags accessFlags, ResourceMiscFlags miscFlags, int structureByteStride)
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

DataStream data

Initial data used to initialize the buffer.

int sizeInBytes

The size, in bytes, of the buffer.

ResourceUsage usage

The usage pattern for the buffer.

BindFlags bindFlags

Flags specifying how the buffer will be bound to the pipeline.

CpuAccessFlags accessFlags

Flags specifying how the buffer will be accessible from the CPU.

ResourceMiscFlags miscFlags

Miscellaneous resource options.

int structureByteStride

The size (in bytes) of the structure element for structured buffers.

Returns
Type Description
Buffer

Create<T>(Device, BindFlags, ref T, int, ResourceUsage, CpuAccessFlags, ResourceMiscFlags, int)

Creates a new instance of the Buffer class.

Declaration
public static Buffer Create<T>(Device device, BindFlags bindFlags, ref T data, int sizeInBytes = 0, ResourceUsage usage = ResourceUsage.Default, CpuAccessFlags accessFlags = CpuAccessFlags.None, ResourceMiscFlags miscFlags = ResourceMiscFlags.None, int structureByteStride = 0) where T : struct
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

BindFlags bindFlags

Flags specifying how the buffer will be bound to the pipeline.

T data

Initial data used to initialize the buffer.

int sizeInBytes

The size, in bytes, of the buffer. If 0 is specified, sizeof(T) is used.

ResourceUsage usage

The usage pattern for the buffer.

CpuAccessFlags accessFlags

Flags specifying how the buffer will be accessible from the CPU.

ResourceMiscFlags miscFlags

Miscellaneous resource options.

int structureByteStride

The size (in bytes) of the structure element for structured buffers.

Returns
Type Description
Buffer

An initialized buffer

Type Parameters
Name Description
T

Type of the data to upload

Create<T>(Device, BindFlags, T[], int, ResourceUsage, CpuAccessFlags, ResourceMiscFlags, int)

Creates a new instance of the Buffer class.

Declaration
public static Buffer Create<T>(Device device, BindFlags bindFlags, T[] data, int sizeInBytes = 0, ResourceUsage usage = ResourceUsage.Default, CpuAccessFlags accessFlags = CpuAccessFlags.None, ResourceMiscFlags miscFlags = ResourceMiscFlags.None, int structureByteStride = 0) where T : struct
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

BindFlags bindFlags

Flags specifying how the buffer will be bound to the pipeline.

T[] data

Initial data used to initialize the buffer.

int sizeInBytes

The size, in bytes, of the buffer. If 0 is specified, sizeof(T) * data.Length is used.

ResourceUsage usage

The usage pattern for the buffer.

CpuAccessFlags accessFlags

Flags specifying how the buffer will be accessible from the CPU.

ResourceMiscFlags miscFlags

Miscellaneous resource options.

int structureByteStride

The size (in bytes) of the structure element for structured buffers.

Returns
Type Description
Buffer

An initialized buffer

Type Parameters
Name Description
T

Type of the data to upload

Create<T>(Device, ref T, BufferDescription)

Creates a new instance of the Buffer class.

Declaration
public static Buffer Create<T>(Device device, ref T data, BufferDescription description) where T : struct
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

T data

Initial data used to initialize the buffer.

BufferDescription description

The description.

Returns
Type Description
Buffer

An initialized buffer

Type Parameters
Name Description
T

Type of the data to upload

Create<T>(Device, T[], BufferDescription)

Creates a new instance of the Buffer class.

Declaration
public static Buffer Create<T>(Device device, T[] data, BufferDescription description) where T : struct
Parameters
Type Name Description
Device device

The device with which to associate the buffer.

T[] data

Initial data used to initialize the buffer.

BufferDescription description

The description.

Returns
Type Description
Buffer

An initialized buffer

Type Parameters
Name Description
T

Type of the data to upload