Class ResourceInfoRegistry

Nested Relationships

Nested Types

Class Documentation

class ResourceInfoRegistry

Provides facilities for registering and retrieving info objects.

Public Functions

ResourceInfoRegistry() = default

Constructs an instance of ResourceInfoRegistry.

uint64_t GetCurrentCallIndex() const

Get this ResourceInfoRegistry's current call index.

Returns

This ResourceInfoRegistry's current call index

void IncrementCallIndex()

Increments this ResourceInfoRegistry's current call index.

ResourceInfo const *GetResourceInfo(ResourceId resourceId) const

Gets a pointer to the ResourceInfo associated with a given ResourceId.

Note

If there is no registerd ResourceInfo with the given ResourceId this method will return nullptr

Parameters

resourceId -- [in] The ResourceId to get the associated ResourceInfo pointer for

Returns

A pointer to the ResourceInfo associated with the given ResourceId

Enumerator<ResourceInfo> GetResourceInfos() const

Gets an Enumerator<> to all registered ResourceInfos.

Note

Subsequent calls to this method invalidate outstanding Enumerator<> objects and Enumerator<>::Iterator objects

Returns

An Enumerator<> to all registered ResourceInfos

Enumerator<ResourceInfo> GetResourceInfos(ResourceInfo::Usage usage, uint64_t callIndex) const

Gets an Enumerator<> to all registered ResourceInfos for a specified ResourceInfo::Usage at a specified call index.

Note

Subsequent calls to this method invalidate outstanding Enumerator<> objects and Enumerator<>::Iterator objects

Parameters
  • usage -- [in] The ResourceInfo::Usage to registered ReseourceInfos for

  • callIndex -- [in] The call index to get registered ResourceInfos for

Returns

An Enumerator<> to all registered ResourceInfos for the specified ResourceInfo::Usage at the specified call index

Enumerator<ResourceInfo::Ex> GetResourceInfoExs(ResourceInfo::Usage usage, uint64_t callIndex, ResourceInfo const *pResourceInfo) const

Gets an Enumerator<> to all registered ResourceInfo::Exs associated with a given ResourceInfo for a specified ResourceInfo::Usage at a specified call index.

Note

Subsequent calls to this method invalidate outstanding Enumerator<> objects and Enumerator<>::Iterator objects

Parameters
  • usage -- [in] The ResourceInfo::Usage to registered ReseourceInfo::Exs for

  • callIndex -- [in] The call index to get registered ResourceInfo::Exs for

  • pResourceInfo -- [in] A pointer to the ResourceInfo to get associated ResourceInfo::Exs for

Returns

An Enumerator<> to all registered ResourceInfo::Exs associated with the given ResourceInfo for the specified ResourceInfo::Usage at the specified call index

std::pair<uint64_t, uint64_t> GetBindingInterval(ResourceInfo::Usage usage, uint64_t callIndex, ResourceInfo const *pResourceInfo) const

Gets the binding interval for a given ResourceInfo for a specificed ResourceInfo::Usage at a specified call index.

Parameters
  • usage -- [in] The ResourceInfo::Usage to get a binding interval for

  • callIndex -- [in] The call index to get a binding interval for

  • pResourceInfo -- [in] A pointer to the ResourceInfo to get the binding interval for

Returns

A std::pair<uint64_t, uint64_t> consisting of the first and last call indices at which the given ResourceInfo was bound for the specified ResourceInfo::Usage and call index

template<typename DerivedType>
inline ResourceInfo const *RegisterResourceInfo(DerivedType const &resourceInfo)

Registers a given ResourceInfo.

Parameters
  • <DerivedType> -- The type of ResourceInfo to register

  • resourceInfo -- [in] A reference to the ResourceInfo to register

Returns

A pointer to the registered ResourceInfo

template<typename DerivedType>
inline ResourceInfo::Ex const *RegisterResourceInfoEx(DerivedType const &resourceInfoEx)

Registers a given ResourceInfo::Ex.

Parameters
Returns

A pointer to the registered ResourceInfo::Ex

void BindResourceInfo(ResourceInfo::Usage usage, ResourceInfo const *pResourceInfo, BindingMonitor *pBindingMonitor = nullptr)

Registers a binding for a given ResourceInfo.

Parameters
template<typename DerivedExType>
inline void BindResourceInfoEx(ResourceInfo::Usage usage, ResourceInfo const *pResourceInfo, DerivedExType const &resourceInfoEx, BindingMonitor *pBindingMonitor = nullptr)

Registers a binding for a given ResourceInfo and ResourceInfo::Ex.

Parameters
ResourceId GenerateShaderId(api_types::ShaderStageFlagBits stage, void const *pShaderBytecode, size_t bytecodeLength)

Returns a shader id by shader source. It is required for APIs that do not use shader handles, DX12 for example.

Parameters
  • stage -- [in] The api_types::ShaderStageFlagBits of the ShaderInfo to register

  • pShaderBytecode -- [in] The bytecode array of the ShaderInfo to register

  • bytecodeLength -- [in] Size of the bytecode array