Home -> IIndexBuffer

Declaration

class IIndexBuffer;

Description

The IIndexBuffer interface represents a buffer containing index attributes, suitable to be bound to an IRenderableNode object. The index attribute is specified by binding an IndexAttribute object to the buffer through the BindIndexAttribute method, prior to calling the AllocateMemory method. Once the AllocateMemory method has been called, the layout and size of the buffer has been fixed, and cannot be changed. A single IndexAttribute must be bound to this buffer prior to calling AllocateMemory.

ImportantImportant

Buffers may be created either in automatic or manual layout mode. Automatic layout buffers are free to allocate memory using whatever memory layout the renderer determines is optimal, and are easiest for applications to work with. Automatic layout buffers cannot be modified directly, instead the contents of the buffer are set and updated through the SetInitialData and QueueDataUpdate methods on the IndexAttribute objects which are bound to them. Manual layout buffers on the other hand require the application to explicitly specify starting location and stride of each attribute. With the layout explicitly defined however, applications are able to manually write to the buffer using the SetRawInitialData and QueueRawDataUpdate methods, potentially updating the contents of multiple attributes at once. Additionally, an alias of the buffer can be created using the AllocateMemoryWithAlias method, allowing the buffer to be directly written to in shaders, such as a compute shader. To allocate a buffer in automatic layout mode, attach attributes using the BindIndexAttribute method. To allocate a buffer in manual layout mode, attach attributes using the BindIndexAttributeManualLayout method. Unless you require the features provided by manual layout mode, it is recommended to use automatic layout buffers.

ImportantImportant

Only a single index attribute can currently be bound to an index buffer. This restriction may be lifted in the future.

Members

Initialization methods

Name Description
Public member Delete
Schedules the object for deletion. After calling this method, the object will be destroyed after the current frame completes drawing.
Public member AllocateMemory
Attempts to allocate memory for the buffer using the supplied index attribute
Public member AllocateMemoryWithAlias
Attempts to allocate memory for the buffer, and alias it with an ITexelArray.

Binding methods

Name Description
Public member BindIndexAttribute
Binds the specified IndexAttribute as a member of the buffer
Public member BindIndexAttributeManualLayout
Binds the specified IndexAttribute as a member of the buffer, with a manually defined buffer offset and stride.

Data methods

Name Description
Public member SetRawInitialData
Allows initial data to be set directly for the buffer where manual layout attributes have been bound with the BindIndexAttributeManualLayout method.
Public member QueueRawDataUpdate
Allows data to be written directly to the buffer where manual layout attributes have been bound with the BindIndexAttributeManualLayout method.

See also