Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IConstantBufferContainer

The IConstantBufferContainer property interface.

This interface provides a way to manage multiple individual constant buffer objects, which each of them holdin a set of different shader variables.


Table members

Methods


AddConstantBuffer(item)

Add a constant buffer with predefined semantics. This method creates and adds a constant buffer to the container, using one of the available predefined semantics defined in IEnums::ConstantBufferItem. If successful, this method returns the zero-based index of the newly created constant buffer within the container; if failed, -1 is returned.

Integer AddConstantBuffer(Murl.IEnums.ConstantBufferItem item)

Parameters
itemThe predefined constant buffer item to add.
Returns
Integer The zero-based index of the buffer in the container, or -1 if failed.

AddConstantBuffer(name)

Add a constant buffer with custom semantics. This method creates and adds a constant buffer to the container, using custom semantics defined via a unique name. If successful, this method returns the zero-based index of the newly created constant buffer within the container; if failed, -1 is returned.

Integer AddConstantBuffer(String name)

Parameters
nameThe custom semantic name.
Returns
Integer The zero-based index of the buffer in the container, or -1 if failed.

GetConstantBufferIndex(item)

Query the location of a predefined constant buffer in the container. This method can be used to query the zero-based index of a constant buffer with given predefined semantics. If the container does not hold a buffer with the requested semantics, -1 is returned.

Integer GetConstantBufferIndex(Murl.IEnums.ConstantBufferItem item)

Parameters
itemThe predefined constant buffer item to query.
Returns
Integer The zero-based index of the buffer, or -1 if not found.

GetConstantBufferIndex(name)

Query the location of a constant buffer with custom semantics. This method can be used to query the zero-based index of a constant buffer with given user-defined semantics. If the container does not hold a buffer with the requested semantics, -1 is returned.

Integer GetConstantBufferIndex(String name)

Parameters
nameThe custom semantic name.
Returns
Integer The zero-based index of the buffer, or -1 if not found.

GetNumberOfConstantBuffers()

Get the total number of individual constant buffers in the container.

Integer GetNumberOfConstantBuffers()

Returns
Integer The total number of buffers added.

GetConstantBufferItem(index)

Query the predefined semantic item of a constant buffer at a given index. If the buffer at the given index represents has predefined semantics, this method returns the actual item, e.g. IEnums::CONSTANT_BUFFER_ITEM_MATERIAL for a material- related buffer. If the buffer is a user-defined one, it returns IEnums::CONSTANT_BUFFER_ITEM_CUSTOM.

Murl.IEnums.ConstantBufferItem GetConstantBufferItem(Integer index)

Parameters
indexThe zero-based index of the buffer to query.
Returns
Murl.IEnums.ConstantBufferItem The predefined constant buffer semantics item.

GetConstantBufferName(index)

Query the semantic name of a constant buffer at a given index. If the buffer at the given index has user-defined semantics, this method returns its actual name string. If it has predefined semantics, an empty string is returned.

String GetConstantBufferName(Integer index)

Parameters
indexThe zero-based index of the buffer to query.
Returns
String The user-defined constant buffer semantics item.

GetConstantBuffer(index)

Get the constant buffer object at a given index.

Murl.Graph.IConstantBuffer GetConstantBuffer(Integer index)

Parameters
indexThe zero-based index of the buffer to retrieve.
Returns
Murl.Graph.IConstantBuffer The constant buffer object.