Diligent::IResourceMapping struct

Resouce mapping.

This interface provides mapping between literal names and resource pointers. It is created by IRenderDevice::CreateResourceMapping().

Base classes

struct IObject
Base interface for all dynamic objects in the engine.

Derived classes

template<typename Base>
class RefCountedObject
Base class for all reference counting objects.

Public functions

auto AddResource(const Char* Name, IDeviceObject* pObject, bool bIsUnique) -> void METHOD() virtual
Adds a resource to the mapping.
auto AddResourceArray(const Char* Name, Uint32 StartIndex, IDeviceObject*const* ppObjects, Uint32 NumElements, bool bIsUnique) -> void METHOD() virtual
Adds resource array to the mapping.
auto RemoveResourceByName(const Char* Name, Uint32 ArrayIndex = 0) -> void METHOD() virtual
Removes a resource from the mapping using its literal name.
auto GetResource(const Char* Name, IDeviceObject** ppResource, Uint32 ArrayIndex = 0) -> void METHOD() virtual
Finds a resource in the mapping.
auto GetSize() -> size_t METHOD() virtual
Returns the size of the resource mapping, i.e. the number of objects.

Function documentation

void METHOD() Diligent::IResourceMapping::AddResource(const Char* Name, IDeviceObject* pObject, bool bIsUnique) virtual

Adds a resource to the mapping.

Parameters
Name in - Resource name.
pObject in - Pointer to the object.
bIsUnique in - Flag indicating if a resource with the same name is allowed to be found in the mapping. In the latter case, the new resource replaces the existing one.

void METHOD() Diligent::IResourceMapping::AddResourceArray(const Char* Name, Uint32 StartIndex, IDeviceObject*const* ppObjects, Uint32 NumElements, bool bIsUnique) virtual

Adds resource array to the mapping.

Parameters
Name in - Resource array name.
StartIndex in - First index in the array, where the first element will be inserted
ppObjects in - Pointer to the array of objects.
NumElements in - Number of elements to add
bIsUnique in - Flag indicating if a resource with the same name is allowed to be found in the mapping. In the latter case, the new resource replaces the existing one.

void METHOD() Diligent::IResourceMapping::RemoveResourceByName(const Char* Name, Uint32 ArrayIndex = 0) virtual

Removes a resource from the mapping using its literal name.

Parameters
Name in - Name of the resource to remove.
ArrayIndex in - For array resources, index in the array

void METHOD() Diligent::IResourceMapping::GetResource(const Char* Name, IDeviceObject** ppResource, Uint32 ArrayIndex = 0) virtual

Finds a resource in the mapping.

Parameters
Name in - Resource name.
ppResource out - Address of the memory location where the pointer to the object with the given name will be written. If no object is found, nullptr will be written.
ArrayIndex in - for arrays, index of the array element.