Resource IDs
-
class D3DRESID
An indirect identifier for a resource.
Resource IDs are used to indirectly identify resources in the engine. The indirection is then used for streaming and stubbing out resources which are not yet loaded. E.g. binding SRVs to shaders is usually done through the shader var system, which in turn uses resource IDs and not raw texture object pointers.
Note
Consists of an index for an entry inside the resource manager and a generation counter to distinguish between different resources stored within the same slot. For most uses these details are of little importance.
Comparison operators
IDs are totally ordered w.r.t. the underlying representation to allow for use in ordered containers. No semantic meaning is attached to the ordering.
Public Functions
-
constexpr D3DRESID() = default
Constructs an invalid resource ID.
-
inline explicit constexpr D3DRESID(unsigned h)
Conversion from the underlying representation.
-
inline explicit operator unsigned() const
Conversion to the underlying representation.
-
inline explicit operator bool() const
Checks validity of the handle (it still might be broken though)
-
inline void reset()
Resets the resource ID to an invalid state.
-
inline unsigned index() const
Gets the entry index for this ID.
-
inline unsigned generation() const
Gets the entry value generation for this ID.
-
inline bool checkMarkerBit() const
Checks whether the ID is not broken (generation MUST be odd)
-
constexpr D3DRESID() = default
Legacy aliases are also provided for compatibility with older code from times where only textures were supported for resource management.